mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.59k stars 1.93k forks source link

`so.Range()` cannot be "overplotted" by an additional mark added with so.Plot.add() #3753

Closed noboss93 closed 2 months ago

noboss93 commented 2 months ago

As far as I understood seaborn.objects correctly, marks that get added later should overplot previous marks. However, it seems like that the so.Range() mark allways stays on top of later added marks.

import seaborn.objects as so

y = range(1,100)
x = range(1,100)

(
    so.Plot(x=x, y=y)
    .add(so.Range(linewidth=5, color="#A20013"), so.Est(errorbar=("pi", 50)), y=[50]*99, orient="y")
    .add(so.Dot(pointsize=30, color="Blue"), so.Agg(func="median"), y=[50]*99, orient="y")
    .add(so.Dot(pointsize=20, color="Green"), so.Agg(func="median"), y=[50]*99, orient="y")

)

image

mwaskom commented 2 months ago

You can pass zorder in artist_kws.