AlgebraOfGraphics.jl icon indicating copy to clipboard operation
AlgebraOfGraphics.jl copied to clipboard

MarkerSize issue

Open Mingyuan1231 opened this issue 1 year ago • 1 comments

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

Mingyuan1231 avatar Oct 05 '24 01:10 Mingyuan1231