I am trying to use cufflinks to plot some charts on jupyter notebook. However, this method doesnât seem to work. An error âAttributeError: âLayoutâ object has no attribute âgetââ shows up. Any ideas?
layout=df.figure()[âlayoutâ]
layout[âxaxisâ][âshowgridâ]=False
df.iplot(layout=layout, x=âxâ, y=âyâ, kind=âbarâ)
Hi @junh.tan,
Try updating your cufflinks to the latest version. Support for plotly.py version 3 was added relatively recently.
Hope that helps! And if not, please include the versions of plotly.py and cufflinks that you have installed.
-Jon
Hi @jmmease,
My cf version is 0.14.5. Plotly.py version is 3.3.0.
Hi @junh.tan,
It looks like support for plotly.py version 3 was added in cufflinks 0.14, so your version should be new enough. In that case, I recommend opening a bug report with the cufflinks project at https://github.com/santosjorge/cufflinks/issues.
Perhaps cufflinks doesnât handle passing a plotly.py graph_objs.Layout
object into iplot
. You could try converting it into a dict
first:
df.iplot(layout=layout.to_plotly_json(), x='x', y='y', kind='bar')
-Jon
Hi @jmmease,
Converting it to a dict first works. Thank you!
1 Like