0

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'
Derek O
  • 16,770
  • 4
  • 24
  • 43
  • as far as i know, cufflinks makes plotly calls under the hood, so this could be a cufflinks related bug. the full traceback shows that it's coming from the `cf.subplots(...)` line – Derek O Nov 30 '22 at 04:26

0 Answers0