Home > Software engineering >  mpld3.fig_to_html throws AttributeError: module 'matplotlib.dates' has no attribute '
mpld3.fig_to_html throws AttributeError: module 'matplotlib.dates' has no attribute '

Time:11-29

I am using mpld3.fig_to_html form the last three months its working fine but from the last two days, it's showing error. All of my code stop workings. Can anyone suggest to me how to solve this error?

error: AttributeError: module 'matplotlib.dates' has no attribute '_SwitchableDateConverter'

also, this simple code throws the same error.

fig = plt.figure()
plt.scatter([1, 10], [5, 9])
html_graph = mpld3.fig_to_html(fig)

collab file: https://colab.research.google.com/drive/17W1_vfOZTYmhodzziNEC7wPiuZuF9Cc1?usp=sharing.

CodePudding user response:

If you're using colab, restart your runtime then reinstall older mpld3 version with !pip install matplotlib==3.2.1 mpld3==0.5.5

  • Related