|
260 | 260 | # ---------------------------------------------------------------------------------------------------------- |
261 | 261 | function boxplot(data::Union{Vector{Vector{T}}, AbstractMatrix{T}}; pos=Vector{Float64}(), |
262 | 262 | first::Bool=true, kwargs...) where T |
| 263 | + _boxplot_10(data, pos, first, KW(kwargs)) |
| 264 | +end |
| 265 | +function _boxplot_10(data, pos, first::Bool, d::Dict{Symbol,Any}) |
263 | 266 | (!isempty(pos) && length(pos) != size(data,2)) && error("Coordinate vector 'pos' must have same size as columns in 'data'") |
264 | | - d, isVert, _fill, showOL, OLcmd, w = helper1_boxplot(kwargs) |
| 267 | + d, isVert, _fill, showOL, OLcmd, w = helper1_boxplot(d) |
265 | 268 | D, Dol = helper2_boxplot(data, pos, w, 0.0, _fill, showOL, isVert) # Two GMTdataset's. Second may be empty |
266 | 269 | Dv = (_fill == "gray70") ? ds2ds(D, G="gray70") : ds2ds(D) # Split it so we can assign colors to each candle. |
267 | 270 | c = false |
|
278 | 281 | # ------------ For groups ---------------------------------------------------------------------------------- |
279 | 282 | function boxplot(data::Array{T,3}; pos=Vector{Float64}(), first::Bool=true, |
280 | 283 | groupwidth=0.75, ccolor=false, kwargs...) where T |
| 284 | + _boxplot_11(data, pos, first, Float64(groupwidth), ccolor==1, KW(kwargs)) |
| 285 | +end |
| 286 | +function _boxplot_11(data, pos::Vector{Float64}, first::Bool, groupwidth::Float64, ccolor::Bool, d::Dict{Symbol,Any}) |
281 | 287 |
|
282 | 288 | (!isempty(pos) && length(pos) != size(data,2)) && error("Coordinate vector 'pos' must have same size as columns in 'data'") |
283 | | - d, isVert, _fill, showOL, OLcmd, w = helper1_boxplot(kwargs) |
| 289 | + d, isVert, _fill, showOL, OLcmd, w = helper1_boxplot(d) |
284 | 290 |
|
285 | 291 | N_grp = size(data,3) # N elements in group |
286 | 292 | boxspacing = groupwidth / N_grp |
|
317 | 323 | # ---------------------------------------------------------------------------------------------------------- |
318 | 324 | function boxplot(data::Vector{Vector{Vector{T}}}; pos=Vector{Float64}(), first::Bool=true, |
319 | 325 | groupwidth=0.75, ccolor=false, kwargs...) where T |
| 326 | + _boxplot_12(data, pos, first, Float64(groupwidth), ccolor==1, KW(kwargs)) |
| 327 | +end |
| 328 | +function _boxplot_12(data, pos, first::Bool, groupwidth::Float64, ccolor::Bool, d::Dict{Symbol,Any}) |
320 | 329 |
|
321 | 330 | (!isempty(pos) && length(pos) != size(data,2)) && error("Coordinate vector 'pos' must have same size as columns in 'data'") |
322 | | - d, isVert, _fill, showOL, OLcmd, w = helper1_boxplot(kwargs) |
| 331 | + d, isVert, _fill, showOL, OLcmd, w = helper1_boxplot(d) |
323 | 332 |
|
324 | 333 | N_in_each_grp = length.(data[:]) # Vec with the N elements in each group |
325 | 334 | N_grp = length(N_in_each_grp) |
@@ -415,8 +424,7 @@ function parse_stats_separator_pen(d, SEPcmd) |
415 | 424 | end |
416 | 425 |
|
417 | 426 | # ---------------------------------------------------------------------------------------------------------- |
418 | | -function helper1_boxplot(kwargs) |
419 | | - d = KW(kwargs) |
| 427 | +function helper1_boxplot(d::Dict{Symbol,Any}) |
420 | 428 | str::String = "Y" |
421 | 429 | str = (is_in_dict(d, [:horizontal :hbar], del=true) !== nothing) ? "X" : "Y" |
422 | 430 | isVert = (str == "Y") |
|
0 commit comments