make_subplots don't support multiple axis on the same track
See original GitHub issueMix the https://plot.ly/python/multiple-axes/ and https://plot.ly/python/subplots/.
In a subplot I don’t see how to setup several yaxis:
import plotly.graph_objs as go
from plotly import tools
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
trace1 = go.Scatter(
x=[1, 2, 3],
y=[40, 50, 60],
name='yaxis data'
)
trace2 = go.Scatter(
x=[2, 3, 4],
y=[4, 5, 6],
name='yaxis2 data',
yaxis='y2'
)
data = [trace1, trace2]
layout = go.Layout(
title='Double Y Axis Example',
yaxis=dict(
title='yaxis title'
),
yaxis2=dict(
title='yaxis2 title',
titlefont=dict(
color='rgb(148, 103, 189)'
),
tickfont=dict(
color='rgb(148, 103, 189)'
),
overlaying='y',
side='right'
)
)
fig = tools.make_subplots(rows=1, cols=1)
fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 1, 1)
# fig = go.Figure(data=data, layout=layout)
iplot(fig)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Multiple axes and subplots · ResGuides-Plotly - maegul
Initialise the figure # two subplots, each in a row, forming one column fig = make_subplots(rows=2, cols=1, shared_xaxes=True) # sharing the x axis....
Read more >Subplots in Python - Plotly
The shared_yaxes argument to make_subplots can be used to link the y axes of subplots in the resulting figure. Here is an example...
Read more >Can't draw spike line across subplots with make_subplots in ...
After upgrading to plotly 4.0.0, I can't see how to create a spike line across shared axes created with make_subplots.
Read more >python - plotly multiple axes that change dynamically with plot
I need to construct a plot with more than 2 y-axes, and I would like the axes to 'hide' and 'unhide' as the...
Read more >Multiple Y-Axes with Plotly | #171 (Plotly Dash #5) - YouTube
I've made many charts using #matplotlib, but it became cumbersome trying to add interactivity. So, I've been creating more interactive ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great thanks, here’s an example on how you can achieve that: https://plot.ly/~chelsea_lyn/13433 You can use multiple axes and define the
domain
andoverlaying
attributesThank very much, this help me a lot, a lot of code was needed to build the plot, but at the end it is working (the zoom it is slower than Bokeh, strange).
The order of domain [0 bottom, 1 top], anchors, overlaying, plus numbering system starting from 1 was strange to setup, I hope next time will be easier.