-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add support in make_subplots for mutiple axes #1544
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
Comments
Hi @marcotama, Yeah, multiple y-axes in subplots is something we've been thinking about for version 4, but we haven't settled on an API yet. My current thinking is to add a new option to elements of the from plotly.tools import make_subplots
fig = make_subplots(
2, 2, specs=[[{'secondary_y': True}, {'secondary_y': True}],
[{'secondary_y': True}, {'secondary_y': True}]])
fig.add_trace(go.Scatter(...), row=1, col=1)
fig.add_trace(go.Scatter(...), row=1, col=1, secondary_y=True) It's admittedly a little clunky, but it would get the job done without too much added API complexity. What do you think? cc @nicolaskruchten @chriddyp |
Hi @jonmmease, It looks simple enough to use. from plotly.tools import make_subplots
fig, ax_info = make_subplots(
2, 2, specs=[[{'secondary_y': True}, {}],
[{'secondary_x': True}, {'secondary_y': True}]])
print(ax_info)
>>> [[('x','y','y2'),('x2','y3')],[('x3','x4','y4'),('x5','y5','y6')]] I know this can be figured out manually, but I fear it is fertile ground for bugs, especially in more complex setups. Edit: funnily enough, I made a mistake with counting axes while writing the above example. |
We would at least add the second y-axis label to the This info is all in the internal |
I think |
Hi @marcotama, I'd appreciate your feedback on #1564 if you have a chance to take a look and give it a spin. Installation instructions at #1564 (comment) |
Hi @jonmmease , I left a comment on the PR page. Apologies for the late reply, I have been busy! |
Done in #1564 |
Hi, this is a feature request, not a bug, so I do not have a minimum example.
My use case is that I have been using
make_suplots
(to generate a quite simple 2x2 layout), and I would now introduce a second y axis in each subplot, in order to obtain the same effect described here: https://plot.ly/python/multiple-axes/I could not find a way to do this through
make_subplots
, but I seem to understand that it is possible by setting the layout. My issue with this approach is that I am afraid to lose some "magic" that is happening inmake_subplots
.Can you advise how to proceed? Is it something you are willing to implement?
The text was updated successfully, but these errors were encountered: