How to get subplot id?

if you have 2X2 subplot grid, you can set x-axis title of lower-left subplot as follows:

fig['layout']['xaxis3'].update(title='xaxis 3 title', showgrid=False)

How do we come up with number 3 in ‘xaxis3’ above? Is there any way to specify just the grid cell coordinate?

Hi @sytelus,

Assuming you created the figure with you can see this information in the grid that’s printed out.

from plotly import tools
fig = tools.make_subplots(rows=2, cols=2)
This is the format of your plot grid:
[ (1,1) x1,y1 ]  [ (1,2) x2,y2 ]
[ (2,1) x3,y3 ]  [ (2,2) x4,y4 ]

There you see that the bottoms left subplot has row 2 and column 1 and involves xaxis3 and yaxis3.

Hope that helps!

1 Like