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

For raincloud plot, jitter_width is documented, but cannot be used #3981

Closed
goulf-3m opened this issue Jun 20, 2024 · 5 comments · Fixed by #4517
Closed

For raincloud plot, jitter_width is documented, but cannot be used #3981

goulf-3m opened this issue Jun 20, 2024 · 5 comments · Fixed by #4517
Labels
Attributes Plot, Block and Scene Attributes bug Makie Backend independent issues (Makie core) plot Related to plot object

Comments

@goulf-3m
Copy link

When I run

Makie.rainclouds([string(x) for x in rand(1:3, 50)], randn(50), jitter_width=0.05)

The error occurs

ERROR: Invalid attribute Scatter for plot type MakieCore.Plot{Makie.rainclouds}.
@goulf-3m goulf-3m added the bug label Jun 20, 2024
@ffreyer ffreyer added Makie Backend independent issues (Makie core) plot Related to plot object Attributes Plot, Block and Scene Attributes labels Aug 28, 2024
@ericphanson
Copy link
Contributor

Just to say I have the same issue, though the error message is different:

Invalid attribute jitter_width for plot type MakieCore.Plot{Makie.rainclouds, Tuple{Vector{String}, Vector{Float64}}}.



The available plot attributes for MakieCore.Plot{Makie.rainclouds, Tuple{Vector{String}, Vector{Float64}}} are:



boxplot_nudge   color      hist_bins      show_boxplot_outliers  whiskerwidth

boxplot_width   cycle      markersize     show_median                        

center_boxplot  dodge      n_dodge        side                               

cloud_width     dodge_gap  orientation    strokewidth                        

clouds          gap        plot_boxplots  violin_limits                      





Generic attributes are:



clip_planes  dim_conversions  model      transformation  yautolimits        

cycle        label            rasterize  xautolimits     zautolimits        

@asinghvi17
Copy link
Member

side_scatter_nudge_default = plot_boxplots ? 0.2 : 0.075
jitter_width_default = 0.05
# Scatter Plot Settings
side_scatter_nudge = to_value(get(plot, :side_nudge, side_scatter_nudge_default))
side_scatter_nudge < 0 && ArgumentError("`side_nudge` should be positive. Change `side` to :left, :right if you wish.")
jitter_width = abs(to_value(get(plot, :jitter_width, jitter_width_default)))
jitter_width < 0 && ArgumentError("`jitter_width` should be positive.")

@ericphanson
Copy link
Contributor

not sure what what you mean @asinghvi17? I think the issue is the attribute system doesn't recognize it so it throws an error

@asinghvi17
Copy link
Member

Ah I sent this before adding context 😅

Yeah, it's just that jitter_width and side_nudge are not listed as attributes. I think that's because they depend on some pre-calculated thing, but side_nudge could just be Makie.automatic by default and jitter_width can stay as is I think.

@ericphanson
Copy link
Contributor

thanks @asinghvi17 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attributes Plot, Block and Scene Attributes bug Makie Backend independent issues (Makie core) plot Related to plot object
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants