Some parts of figure not displayed when converting matplotlib figure to plotly figure and displaying on webpage with dash

There are many limitations in mpl_to_plotly and we haven’t updated this code in years. The code is pretty gnarly and we decided to double down on the native plotly syntax instead of continuing to work on these converters.

So, if it works for you then that’s great! But if it doesn’t, I recommend:

  1. Modifying the returned fig yourself after converting
  2. Or, recreating the figure with the plotly syntax
  3. Or, embedding the matplotlib figure as a static image in your app with html.Img(src='...') where source is the base64 encoded version of the image (https://stackoverflow.com/questions/38061267/matplotlib-graphic-image-to-base64)
2 Likes