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

MarkerSize issue #569

Open
Mingyuan1231 opened this issue Oct 5, 2024 · 1 comment
Open

MarkerSize issue #569

Mingyuan1231 opened this issue Oct 5, 2024 · 1 comment

Comments

@Mingyuan1231
Copy link

I was trying to plot the data which has multiple dimensions. One dimension R only have four values (3,4,5,6), but the MarkerSize will show 5 values (3, 3.75, 4.5, 5.25, 6) in the legend, and I didn't find a way to adjust this in source code, is there method to resolve this?

plt = data(df) * mapping(
    :Fide_Avg => "Output Fidelity", 
    :Succ_Avg => "Success Rate", 
    marker = :N, 
    color = :Fin, 
    markersize = :R) * visual(Scatter)

# Draw the plot
fig = draw(plt; axis=(xticks=0.9:0.025:1, yticks=0.0:0.05:0.65))

I also tried manually adding legend, still not working:

fig=Figure()

g1 = draw!(fig[1,1],plt,scales(
    MarkerSize=(;
        sizerange=(5,15)
    )
), axis=(xticks=0.9:0.025:1, yticks=0.0:0.05:0.65))

legend!(fig[1,3],g1)
colorbar = Colorbar(fig, colormap=:viridis, label="Fin", width=10)
fig[1,2]=colorbar

fig
@jkrumbiegel
Copy link
Member

Yes this is currently hardcoded out of a lack of time. But I think this should probably get the same interface as ticks in Makie, as it seems to be the same problem.

At first I thought you'd always have to show the minimum and maximum marker size which leads to uneven numbers, because otherwise you wouldn't know what your extreme values are from the legend. But I guess other libraries like ggplot also don't do that and show pretty values instead.

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

No branches or pull requests

2 participants