Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Boxplot outliercolor without stepwise doesn't work #123

Open
kescobo opened this issue May 20, 2020 · 0 comments
Open

Boxplot outliercolor without stepwise doesn't work #123

kescobo opened this issue May 20, 2020 · 0 comments

Comments

@kescobo
Copy link

kescobo commented May 20, 2020

Set up data with some outliers:

using Makie, StatsMakie, DataFrames

df = DataFrame(xs = [fill(1, 20)...,
                                    fill(2, 20)...],
                           ys = [rand(0.4:0.01:0.6,18)..., 1.05, -0.05,
                                    rand(0.4:0.01:0.6,18)..., 1.1, -0.1])

Plotting one by one works:

sc = boxplot(df[1:20,:xs], df[1:20, :ys], color=:blue, outliercolor=:red)
boxplot!(sc, df[21:end, :xs], df[21:end, :ys], color=:orange, outliercolor=:purple)

Screen Shot 2020-05-20 at 1 17 27 PM

But other ways of plotting only work for color, not outliercolor.

boxplot(boxplot(df.xs, df.ys, color=[:blue,:orange]) # works
boxplot(df.xs, df.ys, color=[:blue,:orange], outliercolor=[:red, :purple]) # errors
Error showing value of type Scene:
ERROR: buffer position has not the same length as the other buffers.
              Has: 4. Should have: 2
boxplot(Data(df), Group(:xs), :xs, :ys, color=[:blue, :orange]) # works
boxplot(Data(df), Group(:xs), :xs, :ys, 
    color=[:blue, :orange],
    outliercolor=[:red, :purple]) # incorrect output

Screen Shot 2020-05-20 at 1 24 10 PM

boxplot(Data(df), Group(color=:xs), :xs, :ys) # works
boxplot(Data(df), Group(color=:xs, outliercolor=:xs), :xs, :ys) # error
ERROR: MethodError: no method matching compute_attribute(::Nothing, ::Int64, ::Dict{Int64,Int64})
Closest candidates are:
  compute_attribute(::Function, ::Any, ::Any) at /Users/ksb/.julia/packages/StatsMakie/Rwvwo/src/group/scales.jl:6
  compute_attribute(::AbstractArray, ::Any, ::Any) at /Users/ksb/.julia/packages/StatsMakie/Rwvwo/src/group/scales.jl:9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant