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

update dotplot, violin, boxplot #499

Merged
merged 2 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Interpolations = "0.12, 0.13"
KernelDensity = "0.5, 0.6"
MultivariateStats = "0.9"
Observables = "0.2.2, 0.3, 0.4, 0.5"
Plots = "0.28, 0.29, 1.0"
Plots = "1.29"
RecipesBase = "0.6, 0.7, 0.8, 1"
RecipesPipeline = "0.1.6, 0.2, 0.3, 0.4, 0.5"
Reexport = "0.2, 1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/boxplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ notch_width(q2, q4, N) = 1.58 * (q4-q2)/sqrt(N)
end

# make the shape
center = Plots.discrete_value!(plotattributes[:subplot][:xaxis], glabel)[1]
center = Plots.discrete_value!(plotattributes, :x, glabel)[1]
hw = 0.5_cycle(bw, i) # Box width
HW = 0.5_cycle(ww, i) # Whisker width
l, m, r = center - hw, center, center + hw
Expand Down
2 changes: 1 addition & 1 deletion src/dotplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# filter y
groupy = y[filter(i -> _cycle(x,i) == grouplabel, 1:length(y))]

center = Plots.discrete_value!(plotattributes[:subplot][:xaxis], grouplabel)[1]
center = Plots.discrete_value!(plotattributes, :x, grouplabel)[1]
halfwidth = 0.5_cycle(barwidth, i)

offsets = getoffsets(halfwidth, groupy)
Expand Down
2 changes: 1 addition & 1 deletion src/violin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ get_quantiles(n::Int) = range(0, 1, length = n + 2)[2:end-1]
widths = hw * widths / Plots.ignorenan_maximum(widths)

# make the violin
xcenter = Plots.discrete_value!(plotattributes[:subplot][:xaxis], glabel)[1]
xcenter = Plots.discrete_value!(plotattributes, :x, glabel)[1]
xcoords = if (side==:right)
vcat(widths, zeros(length(widths))) .+ xcenter
elseif (side==:left)
Expand Down