I am trying to create a series of sub plots each containing box plots using Plotly. At the moment I have managed to create the following plot;
Unfortunately, this is not exactly what I want. I would like to create a subplot for S1 and S2 rather than A1 and A2 (such that each sub plot will have a green box plot and a red box plot).
Is this possible?
This is my current code.
x = ['S1', 'S1', 'S1', 'S1', 'S1', 'S1', 'S2', 'S2', 'S2', 'S2', 'S2', 'S2'] trace0 = go.Box( y=[1.935, 2.59, 2.97, 2.97, 3.28, 4.315, 1.935, 2.59, 2.97, 2.97, 3.28, 4.315], x=x, name='A1', marker=dict( color='#3D9970' ) ) trace1 = go.Box( y=[0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], x=x, name='A2', marker=dict( color='#FF4136' ) ) fig = tools.make_subplots(rows=1, cols=2) fig.append_trace(trace0, 1, 1) fig.append_trace(trace1, 1, 2) py.iplot(fig)