Hi, I have made a MWE to show the behaviour I would like to avoid. I am plotting two curves, one of them with points and errobars, the other with lines. There are two problems. When avoiding the errorbars, in the legend the items appear with both points and lines. When plotting the errorbars, the items appear with polygons (rectangles) instead of the correct markers. Maybe I have some error in the mapping?
Here is the MWE of the second case:
n = 20
df_a = DataFrame(grp=fill("a", n), x=collect(1:n), y=fill(2, n))
df_b = DataFrame(grp=fill("b", n), x=collect(1:n), y=fill(3, n), z=fill(0.3, n))
set_aog_theme!()
size_inches = (6.2*2, 3*2)
size_pt = 72 .* size_inches
fig = Figure(resolution = size_pt, fontsize = 30)
gridpos = fig[1, 1]
plt_a = data(df_a) *
mapping(:x => L"x", :y=> L"y"; color = :grp => "", marker=:grp=> "", linestyle = :grp => "") *
visual(Lines, linewidth=lw)
plt_b = data(df_b) *(
mapping(:x => L"x", :y=> L"y"; color = :grp => "", marker=:grp=>"", linestyle= :grp => "") *
visual(Scatter)+
mapping(:x => L"x",:y=> L"y",:z;color=:grp=> "", marker=:grp=> "", linestyle = :grp => "")*visual(Errorbars))
f = draw!(gridpos, plt_a+plt_b, axis=(;limits=((0,n),(0,4)),
xgridvisible=false, ygridvisible=false))
legend!(gridpos, f; tellwidth=false, halign=:center, valign=:bottom, margin=(10, 10, 10, 10), patchsize=(20,10))
display(fig)
leg = fig.content[2]
leg_items = leg.blockscene.children[1].plots
display(leg_items)
When displaying fig.content[2].blockscene.childer[1].plots
it can be seen that there are 3 polygons. I think that the first one is correct, but not the other two.
Here is the plot for the second case.
![image|690x333](upload://lVVF5c2GCPhJmnKJv73rpnoCu1z.png
Here is the plot for the first case (without errobars):
There it can be seen that in the legend
a
shouldn’t have a point while b
should’t have the line segment.Thank you very much.