Closed
Description
Hello, matplotlib recently merged a change that removed provide variables from Axis: matplotlib/matplotlib#18769. There are at least 2 places in plotly code that reference these variables:
,In particular I hit this bug when converting matplotlib to pyplot.
- matplotlib>=3.3.3
- plotly>=4.12.0
Repro:
import plotly
import matplotlib.pyplot as plt
fig = plt.figure(1)
ax = plt.plot([1,2,3])
plotly.tools.mpl_to_plotly(fig)
results in
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-c2ca21d8fe91> in <module>()
1 fig = plt.figure(1)
2 ax = plt.plot([1,2,3])
----> 3 plotly.tools.mpl_to_plotly(fig)
6 frames
/usr/local/lib/python3.6/dist-packages/plotly/matplotlylib/mplexporter/utils.py in get_grid_style(axis)
244 def get_grid_style(axis):
245 gridlines = axis.get_gridlines()
--> 246 if axis._gridOnMajor and len(gridlines) > 0:
247 color = export_color(gridlines[0].get_color())
248 alpha = gridlines[0].get_alpha()
AttributeError: 'XAxis' object has no attribute '_gridOnMajor'
FWIW, i think the fix is to replace these calls with _major_tick_kw['gridOn']
.
Thank you,
Tim
Metadata
Metadata
Assignees
Labels
No labels