Closed Vindaar closed 6 years ago
While this is cool idea, I agree with your concern about the maintenance (and documentation) burden. Maybe having an example that does some of this, without adding to the library would be preferable.
Only took me several months, but finally went back to finish this PR.
Since just adding an option to calculate the width of bars automatically, we can now have more fine grained control. Either set a specific width, set individual widths for each element or have the width calculated automatically (in addition to the default of course).
Also allows the bars to be interpreted such that the location represents the left edge of the bar, instead of the center.
Finally, also adds the option to change the orientation to horizontal, if desired.
edit: I named the examples starting from 14, assuming @remigijusj will be merged before. I'll rebase this PR onto the then master.
I merged the contour PR. Ready for rebase.
Rebased and fixed a bug. :)
nice!
edit: see the comment below for an update.
~Based on the "save image" PR.~
~This is still WIP, because I only hacked it in, without thinking too much about potential consequences for other use cases than I had so far.~
~It allows to automatically calculate the bin with of a bar plot based on the given
x
sequence.x
should contain the bin edges of the resulting histogram. The main reason to implement it, is to allow unequal bin width, like for example in the following plot:~The following is not going to be part of this PR, but left as ideas
Possible future feature (afaik CERN's ROOT allows this):
func
like for example:or even more conveniently making use of @Yardanico's nice math expression evaluator library (https://github.com/Yardanico/nim-mathexpr):
so that
where linspace is the numpy equivalent. The idea would be a simple function call like
Typing this feature here though makes me feel like the user convenience vs. the maintenance effort might not be worth it though, haha. I'll leave this here as a reference though. But hmm, the feature using the math expression library would be neat...