Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorbar too far to the right with legend false using PlotlyJS backend[BUG] #4942

Open
mattcbro opened this issue Jun 13, 2024 · 0 comments
Open

Comments

@mattcbro
Copy link

This code produces a right offset colorbar, leaving too much space.

using Plots
plotlyjs()
#gr()

Nsize = 50
clevel = 10  * rand(Nsize)
xords = 100 * rand(Nsize)
yords = 100 * rand(Nsize)
scatter(xords, yords,  marker_z=clevel, legend=:false,  colorbar=:true)

The plot looks like this:
badscatter

If you replace plotlyjs() with gr() you get this:
goodscatter

It seems that plotlyjs is creating space for the legend even if it's not supposed to be there. I might also mention that trying to put the colorbar at the :top :bottom :left positions doesn't work as well for plotlyjs(). Also in plotlyjs() the aspect ratio is messed up when the colorbar is added. It's almost impossible to get equal grid lines, distorting circles and squares.

This is for Plots v1.40.1 and PlotlyJS v0.18.13 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants