Open jdtrebbien opened 2 years ago
Which environment are you running this in? JupyterLab? Dash? Also, if you mouse over the Plotly logo that appears in the top-right, is there a version number for Plotly.js listed there?
I am using JupyterLab and there is no version number appearing when hovering over the plotly logo.
OK, in that case, you're running plotly
5.8.0 but somehow your JupyterLab extension is way behind. Are you running JupyterLab yourself or connecting to a centrally-hosted JupyterHub? And which version of JupyterLab are you running: 2.x or 3.x?
Ok, I found a way to fix this. I noticed that the colorbar is rotated when saving the plot (using kaleido), which is why I tried changing the renderer in the fig.show() and it worked. The renderer used before was 'plotly_mimetype+notebook' and I changed it to 'png'. It was also working when choosing 'chrome' to open the plot in a new tab.
I am using jupyter lab version 2.2.5.
Same problem here. Plot looks like this in Jupyter:
And like this in the browser after exporting to HTML (with a page loading <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
).
I checked the exported HTML. orientation is as expected:
Please note that plotly-latest.min.js
is in fact not the latest version. We stopped updating that URL when Plotly.js 2.0 came out to avoid breaking users of that URL, which is now forever pinned to v1.58.5
Ah, that solved the problem! Now using <script src="https://cdn.plot.ly/plotly-2.20.0.min.js"></script>
.
Fwiw, I think not updating plotly-latest.min.js
is very misleading. People using that expect their code to break on major releases. So I don't see a reason to stop updating it.
I dont if its best practice, but since I have already submitted a stackoverflow question for this I will just link it here
In short: I updated my plotly [5.8.0] to use the newly implemented orientation of the colorbar to make it horizontally, but it's not changing in any way.