Skip to content

Commit 3985a8a

Browse files
authored
Add thin some wrappers do bolxplot to avoid the costs of kwargs. Move some files to extras. (#1941)
* Add thin some wrappers do bolxplot to avoid the costs of kwargs * Update the includes
1 parent 74cca71 commit 3985a8a

7 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/GMT.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ include("filter1d.jl")
215215
include("fitcircle.jl")
216216
include("findpeaks.jl")
217217
include("finish_PS_nested.jl")
218-
include("fourcolors.jl")
219218
include("gadm.jl")
220219
include("gmt2kml.jl")
221220
include("gmtbinstats.jl")
@@ -274,7 +273,6 @@ include("makecpt.jl")
274273
include("mapproject.jl")
275274
include("maregrams.jl")
276275
include("marker_name.jl")
277-
include("montage.jl")
278276
include("movie.jl")
279277
include("nearneighbor.jl")
280278
include("pastplates.jl")
@@ -297,7 +295,6 @@ include("psmask.jl")
297295
include("psscale.jl")
298296
include("psrose.jl")
299297
include("pssolar.jl")
300-
include("analemma.jl")
301298
include("pstext.jl")
302299
include("psxy.jl")
303300
include("pswiggle.jl")
@@ -331,10 +328,14 @@ include("utils_project.jl")
331328
include("choropleth_utils.jl")
332329
include("drawing/Drawing.jl")
333330
include("extras/anaglyph.jl")
331+
include("extras/analemma.jl")
332+
include("extras/fourcolors.jl")
334333
include("extras/hampel_outliers.jl")
335334
include("extras/isoutlier.jl")
336335
include("extras/lowess.jl")
337336
include("extras/mapsize2region.jl")
337+
include("extras/montage.jl")
338+
include("extras/choropleth.jl")
338339
include("extras/seismicity.jl")
339340
include("extras/okada.jl")
340341
include("extras/weather.jl")
File renamed without changes.
File renamed without changes.

src/statplots.jl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,11 @@ end
260260
# ----------------------------------------------------------------------------------------------------------
261261
function boxplot(data::Union{Vector{Vector{T}}, AbstractMatrix{T}}; pos=Vector{Float64}(),
262262
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})
263266
(!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)
265268
D, Dol = helper2_boxplot(data, pos, w, 0.0, _fill, showOL, isVert) # Two GMTdataset's. Second may be empty
266269
Dv = (_fill == "gray70") ? ds2ds(D, G="gray70") : ds2ds(D) # Split it so we can assign colors to each candle.
267270
c = false
@@ -278,9 +281,12 @@ end
278281
# ------------ For groups ----------------------------------------------------------------------------------
279282
function boxplot(data::Array{T,3}; pos=Vector{Float64}(), first::Bool=true,
280283
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})
281287

282288
(!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)
284290

285291
N_grp = size(data,3) # N elements in group
286292
boxspacing = groupwidth / N_grp
@@ -317,9 +323,12 @@ end
317323
# ----------------------------------------------------------------------------------------------------------
318324
function boxplot(data::Vector{Vector{Vector{T}}}; pos=Vector{Float64}(), first::Bool=true,
319325
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})
320329

321330
(!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)
323332

324333
N_in_each_grp = length.(data[:]) # Vec with the N elements in each group
325334
N_grp = length(N_in_each_grp)
@@ -415,8 +424,7 @@ function parse_stats_separator_pen(d, SEPcmd)
415424
end
416425

417426
# ----------------------------------------------------------------------------------------------------------
418-
function helper1_boxplot(kwargs)
419-
d = KW(kwargs)
427+
function helper1_boxplot(d::Dict{Symbol,Any})
420428
str::String = "Y"
421429
str = (is_in_dict(d, [:horizontal :hbar], del=true) !== nothing) ? "X" : "Y"
422430
isVert = (str == "Y")

src/utils.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,4 +1805,3 @@ function get_show_fmt_savefig(d, show::Bool=false)
18051805
end
18061806

18071807
include("getdcw.jl")
1808-
include("choropleth.jl")

0 commit comments

Comments
 (0)