How can we make a faceted grid in subplots in Plotly? For example I want to plot the total_bill
versus tip
five times in subplots. I tired to do the following:
import plotly.plotly as py
import plotly.figure_factory as ff
from plotly import tools
subfigs = tools.make_subplots(rows= 5, cols=1)
import pandas as pd
tips = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/tips.csv')
for i in enumerate(tips.columns.tolist()):
fig = ff.create_facet_grid(
tips,
x='total_bill',
y='tip',
color_name='sex',
show_boxes=False,
marker={'size': 10, 'opacity': 1.0},
colormap={'Male': 'rgb(165, 242, 242)', 'Female': 'rgb(253, 174, 216)'}
)
subfigs.append_trace(fig, i+1, 1)
pyo.iplot(fig)
This does not work, because the faceted grid created by the figure factory is not considered as trace. Is there a way of doing this? This answer did not help because as it seemed to me cufflinks
does not accept faceted grids