Try drawing a side-by-side pie chart with the following code, always saying I need to define xaxis. How do I solve this?
CODE1:
import cufflinks as cf
cf.go_offline()
df=cf.datagen.bubble(10,50,mode='stocks')
df['categories1'] = df['categories']
df['tmp'] =1
cf.subplots([
df.figure(kind='pie',labels='categories',values='tmp'),
df.figure(kind='pie',labels='categories1',values='tmp')
],shape=(1,2)).iplot()
CODE2:
figs = cf.figures(df,[
dict(kind='pie',labels='categories',values='tmp'),
dict(kind='pie',labels='categories1',values='tmp')
],asList=True)
base_layout = cf.tools.get_base_layout(figs)
sp = cf.subplots(figs,shape=(1,2),base_layout=base_layout,vertical_spacing=.15,horizontal_spacing=.03)
sp['layout'].update(showlegend=False)
cf.iplot(sp)
ERROR MESSAGE:
Did you mean "ids"?
Bad property path:
xaxis
^^^^^
KeyError: 'xaxis'