-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple y axes -> only one scatter shows up #3074
Comments
Here's a working version: https://codepen.io/etpinard/pen/LgNaZa?editors=0010 where I deleted Explanations: we don't allow setting
The logic is the following: plotly.js/src/plots/cartesian/layout_defaults.js Lines 128 to 141 in 48209a0
Also note, we don't draw cartesian axes that have no traces and no layout component (i.e. no annotations/shapes/images) attached to them, except for empty I hope this helps. |
Thanks for the response and explanation! The part about disallowed That said, despite having read the docs I admittedly do not understand why the Thanks again for your help. |
The "third" meaning
I'm only a little lost here. If you don't see |
OK, great, we're on the same page here
Given the above, the original codepen shows the scenario. Since both yaxis2 and yaxis3 have Based on your earlier comment ("we don't allow setting Or maybe the user is required to provide a chain of
What would a use case be where that is desired? It feels like an antifeature to me but I'm probably missing something that the designers had in mind. It seems like it would be much more straightforward to always "overlay" and rely on To get back to my original use case, I am hoping to do something dynamic where there may or may not be anything on yaxis1. In the working example you provided, anything on yaxis1 will be hidden. Is there a straightforward way to ensure that all axes are shown? |
|
We don't allow setting overlaying value corresponding to axes that themselves have an overlaying key set. |
If you want to ensure |
@alexcjohnson gotcha, I will do that. @etpinard thanks for the insets example. That makes sense;
I beg to differ - you do allow it. I've been doing it and the resulting undefined behavior is one of the main causes of my confusion! Would it be feasible to add a validation error? You've both explained a lot to me and now |
I guess that depends what you mean by allowing it. You're certainly allowed to set things that way, and plotly.js won't error out (it never does on "attribute" errors). In this case, plotly.js simply ignores that invalid That said, |
Ahhh, OK, I expected a more detailed level of validation because I use plotly.py, which does this kind of validation. ccing @jonmmease to maybe take this issue back across to plotly/plotly.py#1200. would it be reasonable to add validation in plotly.py when invalid value is provided for |
Ok. Looks like this issue won't result in a PR in this PR. Closing. Thanks for posting and thanks for the documentation PR @thatneat ! |
This discussion was incredibly useful to help me debug why I was not getting curves on my plots. You mean that 'overlapping: "y"' is not short-hand for 'overlapping: "yes"'..... I spent 24 sleep deprived hours on this. Now that I've got it all working, everything makes sense. And that solution was to simply insert {visible: false}. Wow. So neat. Er... is this in the documentation yet? |
Issue
When plotting data on multiple Y axes, particularly when nothing is plotted on the primary Y axis, sometimes plotly will only show one series.
Repro
https://codepen.io/jasoncurtis/pen/zmqNMQ?editors=0010
Expected behavior
Two series are plotted.
Actual behavior
Two series show up in the legend, but only one series is plotted.
Workaround
If you change
'y2'
in the repro code above to 'y1
', both series will show up. However, it's not always reasonable to assume there will be data on y1 - I am trying to write a purpose-specific API that uses plotly in such a way that I cannot guarantee there will be something on y1 without significant extra complexity.Related:
The text was updated successfully, but these errors were encountered: