Editing subplot layouts (Adding shapes, drop-down menus)


#1

Is there a way to edit subplot layouts beyond modifying the axes? I know the layout for the entire figure can be accessed as a dictionary (e.g. fig[‘layout’]) but can a full layout dictionary be accessed for the subplots?

I would like to be able to use something like fig[‘layout’][‘subplot1layout’].update(shapes=[{‘type’: ‘rect’, ‘x0’: 0, ‘x1’: 1, ‘y0’: 0, ‘y1’: 1, ‘line’: {‘color’: ‘rgba(0, 0, 0, 1)’}}]


#2

Hi there. Take a look at this tutorial. It looks like you want to access the actual data in each subplot. That information is found in data in the fig object. So something like fig['data'][0] for one of the subplots.


#3

@Adam if willing to define a different shape for each subplot, would those need to be defined with the data or with with the layout?


#4

Andrea,

I apologize for the late reply.

You would need to do it with the layout. Look at this example. The parameters xaxis1, xaxis2, etc are used to denote the domains of each of these axes. To change the subplot layout, change these values.