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

Contourf for multiple histograms only showing one filled contour #61

Open
odunbar opened this issue Oct 21, 2024 · 3 comments
Open

Contourf for multiple histograms only showing one filled contour #61

odunbar opened this issue Oct 21, 2024 · 3 comments

Comments

@odunbar
Copy link

odunbar commented Oct 21, 2024

Issue

Hi folks, thanks for the great package! I'm trying to compare two different 5D histograms. In the case that there is more than one histogram the Contourf option does not provide a gradient of fill-alphas, all appear filled. I have plots below to illustrate the issue.

I find this bug on PairPlots.jl v2.9+ but not on v2.8.0.

p = pairplot(
    data_rf => (PairPlots.Contour(sigmas = 1:1:3),),
    data_gp => (PairPlots.Contour(sigmas = 1:1:3),),
)
p = pairplot(
    data_rf => (PairPlots.Contourf(sigmas = 1:1:3),),
    data_gp => (PairPlots.Contourf(sigmas = 1:1:3),),
)

Apologies I dont have a dataset for MWE yet but the dataset are created as

# length(labels) = 5 # name
# size(samples) = (5,250_000) # data
data_gp = (; [(Symbol(labels[i]), samples[i,:]) for i in 1:length(labels)]...)

Desired result from v2.8.0

Received result from v2.9.2

Note: v2.9.2 works fine for a single histogram

Some other relevant packages setup

On julia v1.10.5

CairoMakie v0.12.14
PairPlots v2.9.1 (<= or 2.9.2)
StatsBase v0.33.21
Distributions v0.25.112
@sefffal
Copy link
Owner

sefffal commented Oct 21, 2024

Hi @odunbar , thanks for the bug report. The default styles for multi-series histograms has changed in the latest version (Note: we don't consider changes to the default styles a breaking change).

Do you get the desired result if you pass the following?

p = pairplot(
    PairPlots.Series(data_rf, color=Makie.wong_colors(0.5)[1]) => (PairPlots.Contourf(sigmas = 1:1:3),),
    PairPlots.Series(data_gp, , color=Makie.wong_colors(0.5)[2]) => (PairPlots.Contourf(sigmas = 1:1:3),),
)

BTW as an aside, if you want more or easier control over the labels in the plots, you can pass a dictionary e.g.:

tbl = (;a = randn(100), b=randn(100))
pairplot(
    tbl,
    labels=Dict(:a=>"series A", :b=>"series B")
)

@odunbar
Copy link
Author

odunbar commented Oct 22, 2024

This does not seem to like the color optional argument:
with PairPlots v2.9.2

ERROR: LoadError: MethodError: no method matching (Plot{})(::@NamedTuple{}; color::ColorTypes.RGBA{…})

Closest candidates are:
  (Plot{Func})(::Tuple, ::Dict) where Func got unsupported keyword argument "color"
   @ Makie ~/.julia/packages/Makie/6c4lt/src/interfaces.jl:260

@sefffal
Copy link
Owner

sefffal commented Oct 23, 2024

Maybe you have a different version of Makie?

julia> p = pairplot(
           PairPlots.Series(data_rf, color=Makie.wong_colors(0.5)[1]) => (PairPlots.Contourf(sigmas = 1:1:3),),
           PairPlots.Series(data_gp, color=Makie.wong_colors(0.5)[2]) => (PairPlots.Contourf(sigmas = 1:1:3),),
       )

 pkg> st Makie CairoMakie
Status `~/.julia/environments/orbits/Project.toml`
⌃ [13f3f980] CairoMakie v0.12.11
⌅ [ee78f7c6] Makie v0.21.11
image

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