unfoldtoolbox / UnfoldMakie.jl

Plotting tools for Unfold.jl based on Makie.jl and AlgebraOfGraphics.jl
MIT License
15 stars 7 forks source link

specifying visual=(;colorrange=[1,2]) is ignored in legend #161

Open behinger opened 2 months ago

behinger commented 2 months ago

plot_topoplotseries!(Figure(size=(1280,250)),dur_diff,0.2;positions=pos,mapping=(;y=:diff,row=:overlap_modelled),visual=(;colorrange=[-2,2],enlarge=1.0,contours=false,label_scatter=(markersize=2, strokewidth=0,)))

just the colorbar is wrong, the actual plot changed

grafik

vladdez commented 2 months ago

Why actually we compute colorranges in this way

function extract_colorrange(data_mean, y)
    # aggregate the data over time bins
    # using same colormap + contour levels for all plots
    (q_min, q_max) = Statistics.quantile(data_mean[:, y], [0.001, 0.999])
    # make them symmetrical
    q_min = q_max = max(abs(q_min), abs(q_max))
    q_min = -q_min
    colorrange = (q_min, q_max)
    return colorrange
end

Why not just take extreme values?

behinger commented 2 months ago

the 0.1% allows for outliers, but not the maximum