allow combining histogram with visual(Stairs)#591
Conversation
|
I've thought about similar things as well, I'm not sure if I can think of two options. One would be to instead multiply with a The other option is to add a keyword to the transformation itself in order to choose the desired plot primitive. Then I would have no problem with modifying the data internally, that's entirely expected. I think in general this will have to be done for some transformations because they can create multiple layers with different visuals. If you have that, post-multiplying with |
1438673 to
84e51d6
Compare
|
You are right, the more I thought about it the less convinced I was that my initial proposal was the right way to go. I now tried implementing your second suggestion with the |
|
Bump :) |
|
This would also need an addition to the docstring of My only hesitation is that I haven't yet thought about what to do in multi-layer transforms and if those should share an interface with this situation here, but maybe that's premature API optimization, in general passing a |
and other plot types such as `Scatter`. Possibly an alternative to MakieOrg#572. The only drawback here is that the `visual(...)` needs to come before `histogram()`, otherwise an error is thrown because `width` is not mapped for other plot types. What do you think of this approach?
d6a5394 to
833bc69
Compare
|
Thanks for the comments and suggestions! I exported
Hmm, yeah, I must admit I haven't thought about the multi-layer case until now, what kind of applications were you thinking of? As you said though, I would probably go with this for now and we can always revisit when it comes up again. |
jkrumbiegel
left a comment
There was a problem hiding this comment.
Ok I've thought about this again and I think Visual is not quite right here after all. The reason being that the visual attributes are not necessary to control the computation of the histogram data for the given plottype. For that you only need the type. And there's already the documented way of merging in attributes by appending a * visual(...) so we don't need to duplicate that for now by exporting Visual which is sort of confusing anyway. Maybe later with multilayer transformations. But for this case, a plottype argument is probably the easiest overall. This could also be an optional positional arg. I kind of like histogram(Stairs). What do you think?
|
Yes, agree that's better! Implemented the changes |
|
Bump |
and other plot types such as
Scatter. Possibly an alternative to #572.The only drawback here is that the
visual(...)needs to come beforehistogram(), otherwise an error is thrown becausewidthis notmapped for other plot types. What do you think of this approach?