Hi all,
I’ve been trying to make showlegend work but to no avail. I’m having the same issue as Adding shapes to legend does not work but the fix mentioned there does not work for me. Using the code as given in example Shapes in Python with Python 3.10.11, plotly==5.19 and pandas==2.0.3. It does not seem to throw any error but does not show the shapes in the legend. Is there another fix to this issue?
Thanks
Have you tried updating your pandas version? In my case, this was what (miraculously) fixed the issue. I updated to pandas 2.1.3.
I tried using the same plotly (5.18) and pandas (2.1.3) versions suggested in your post and it did not work for me. Surprisingly, plotly 5.19 and pandas 2.0.3 worked for me on another machine. Are you aware if there are other dependent libraries that need changing/updating?
That is surprising indeed (and went similarly for me back then)! My main guess would of course be Dash, for which I used 2.14.2.
I am currently only attempting to run it on a Jupyter notebook and hopefully on a Streamlit app later on.
I see. I was using jupyter-client=7.3.4 and jupyter-core=4.11.1 at the time but, like I mentioned, updating pandas was ultimately what fixed it for me.
Since you mentioned that you have it working on another machine, I would suggest to work your way backward from that by updating your packages step by step to the ones on the working machine. This is how I found out about my pandas version. Since not too many packages are needed to run the Shapes in Python example code, I would hope that you can find the responsible package rather quickly.