From f96de7f5631b760b09395f7c519bd57475fc7bcf Mon Sep 17 00:00:00 2001 From: Joaquim Date: Wed, 8 Apr 2026 16:28:13 +0100 Subject: [PATCH 1/7] Swich an include order and add a precompile --- src/GMT.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GMT.jl b/src/GMT.jl index 34959bf2b..455165ca0 100644 --- a/src/GMT.jl +++ b/src/GMT.jl @@ -205,6 +205,7 @@ include("common_options.jl") const LEGEND_TYPE = Ref{legend_bag}(legend_bag())# To store Legends info include("beziers.jl") include("brokenaxes.jl") +include("choropleth_utils.jl") include("circfit.jl") include("crop.jl") include("custom_symb_funs.jl") @@ -327,8 +328,8 @@ include("trend2d.jl") include("xyz2grd.jl") include("utils.jl") include("utils_project.jl") -include("choropleth_utils.jl") -include("drawing/Drawing.jl") +include("xkcd.jl") +#include("drawing/Drawing.jl") include("extras/anaglyph.jl") include("extras/analemma.jl") include("extras/fourcolors.jl") @@ -448,6 +449,7 @@ end #Base.precompile(Tuple{Dict{Symbol, Any}, Vector{String}}) # Here it doesn't print anything. #Base.precompile(Tuple{typeof(Base.vect), Array{String, 1}, Vararg{Array{String, 1}}}) Base.precompile(Tuple{typeof(GMT.axis), Base.Dict{Symbol, Any}, Bool, Bool, Bool, Bool, Base.Dict{Symbol, Any}}) +Base.precompile(Tuple{typeof(GMT.axis), NamedTuple{(:axes, :annot, :grid), Tuple{Symbol, Symbol, Int64}}, Base.Dict{Symbol, Any}}) function __init__(test::Bool=false) clear_sessions(3600)# Delete stray sessions dirs older than 1 hour From 3af742e166cb8039c31b90d5d7d395dc6e123eb3 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Wed, 8 Apr 2026 16:29:00 +0100 Subject: [PATCH 2/7] A commented xkcd line --- src/plot.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plot.jl b/src/plot.jl index 644d9e824..ebfdba8d5 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -105,6 +105,8 @@ end function _plot(arg1, first::Bool, d::Dict{Symbol, Any}) # Broken axis — intercept before anything else is_in_dict(d, [:breakx :breaky :xranges :yranges]; del=false) !== nothing && return _brokenplot(mat2ds(arg1), first, d) + # xkcd style + #is_in_dict(d, [:xkcd]; del=false) !== nothing && return _xkcd_plot(arg1, first, d) # First check if arg1 is a GMTds of a linear fit and if yes, call the plotlinefit() fun if (isa(arg1, GDtype) && is_in_dict(d, [:linefit :regress]; del=false) !== nothing) att = isa(arg1, GMTdataset) ? arg1.attrib : arg1[1].attrib From da8e13fc5e2f873b878f4c4582e420cb767240cc Mon Sep 17 00:00:00 2001 From: Joaquim Date: Thu, 9 Apr 2026 03:50:43 +0100 Subject: [PATCH 3/7] Fix regression in _mat2img_u16() --- src/utils_types.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils_types.jl b/src/utils_types.jl index be50effe1..fb06d3c56 100644 --- a/src/utils_types.jl +++ b/src/utils_types.jl @@ -1444,7 +1444,7 @@ function _mat2img_u16(@nospecialize(mat), x::Vector{Float64}, y::Vector{Float64} # Use the keyword `noconv=true` to return GMTimage UInt16 type. I.e., no conversion to UInt8 if ((is_in_dict(d, [:noconv])) !== nothing) # No conversion to UInt8 is wished - return helper_mat2img(mat, x, y, v, hdr, proj4, wkt, GMTcpt(), false, d) + return helper_mat2img(mat, x, y, v, hdr, proj4, wkt, GMTcpt(), get(d, :is_transposed, false), d) end img = isempty(img8) ? Array{UInt8, ndims(mat)}(undef, size(mat)) : img8 From aea4d8da94d4e1ac3f566ea2e823c6fea80cb3e6 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Thu, 9 Apr 2026 03:51:14 +0100 Subject: [PATCH 4/7] Fix regression in rescale() --- src/utils.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 49b2388e9..41151592d 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -755,10 +755,10 @@ function rescale(A::AbstractArray; low=0.0, up=1.0, inputmin=NaN, inputmax=NaN, elseif (isa(stretch, Tuple) || (isvector(stretch) && length(stretch) == 2)) _inputmin, _inputmax = stretch[1], stretch[2] end - (isnan(inputmin)) && (mi::Float64 = (isa(A, GItype)) ? A.range[5] : minimum_nan(A)) - (isnan(inputmax)) && (ma::Float64 = (isa(A, GItype)) ? A.range[6] : maximum_nan(A)) - _inmin::Float64 = (isnan(inputmin)) ? mi : _inputmin - _inmax::Float64 = (isnan(inputmax)) ? ma : _inputmax + (isnan(_inputmin)) && (mi::Float64 = (isa(A, GItype)) ? A.range[5] : minimum_nan(A)) + (isnan(_inputmax)) && (ma::Float64 = (isa(A, GItype)) ? A.range[6] : maximum_nan(A)) + _inmin::Float64 = (isnan(_inputmin)) ? mi : _inputmin + _inmax::Float64 = (isnan(_inputmax)) ? ma : _inputmax d1 = _inmax - _inmin (d1 <= 0.0) && error("Stretch range has inputmin > inputmax.") d2 = up - low @@ -775,7 +775,7 @@ function rescale(A::AbstractArray; low=0.0, up=1.0, inputmin=NaN, inputmax=NaN, sc *= _tmax low *= _tmax if (have_nans) - if (isnan(inputmin) && isnan(inputmax)) + if (isnan(_inputmin) && isnan(_inputmax)) if (type == UInt8) @inbounds for k = 1:numel(A) isnan(A[k]) && (o[k] = 0; continue); o[k] = round(UInt8, low + (A[k] -_inmin) * sc) end else @@ -789,7 +789,7 @@ function rescale(A::AbstractArray; low=0.0, up=1.0, inputmin=NaN, inputmax=NaN, end end else - if (isnan(inputmin) && isnan(inputmax)) + if (isnan(_inputmin) && isnan(_inputmax)) if (type == UInt8) @inbounds for k = 1:numel(A) o[k] = round(UInt8, low + (A[k] -_inmin) * sc) end else @@ -807,7 +807,7 @@ function rescale(A::AbstractArray; low=0.0, up=1.0, inputmin=NaN, inputmax=NaN, oType = (eltype(A) <: AbstractFloat) ? eltype(A) : Float64 o = Array{oType}(undef, size(A)) if (oType <: Integer && have_nans) # Shitty case - if (isnan(inputmin) && isnan(inputmax)) # Faster case. + if (isnan(_inputmin) && isnan(_inputmax)) # Faster case. @inbounds for k = 1:numel(A) isnan(A[k]) && (o[k] = 0; continue); o[k] = low + (A[k] -_inmin) * sc end else @inbounds for k = 1:numel(A) @@ -816,7 +816,7 @@ function rescale(A::AbstractArray; low=0.0, up=1.0, inputmin=NaN, inputmax=NaN, end end else - if (isnan(inputmin) && isnan(inputmax)) # Faster case. No IFs in loop + if (isnan(_inputmin) && isnan(_inputmax)) # Faster case. No IFs in loop @inbounds for k = 1:numel(A) o[k] = low + (A[k] -_inmin) * sc end else @inbounds for k = 1:numel(A) From 5794eb2b668bd516ae1122988e8350b8640e0a49 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Thu, 9 Apr 2026 03:52:02 +0100 Subject: [PATCH 5/7] Fix regression in getauto option. --- src/pshistogram.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pshistogram.jl b/src/pshistogram.jl index 5a0c8f51c..f841cb349 100644 --- a/src/pshistogram.jl +++ b/src/pshistogram.jl @@ -165,6 +165,7 @@ function histogram_helper(cmd0::String, arg1, O::Bool, K::Bool, d::Dict{Symbol,A do_auto = ((val_auto = find_in_dict(d, [:auto :thresholds])[1]) !== nothing) ? true : false # Automatic bounds detetion (val_auto == 1) && (val_auto = nothing) # If auto=true, we want to pass a nothing to the find_histo_limits() fun do_getauto = ((val_getauto = find_in_dict(d, [:getauto :getthresholds])[1]) !== nothing) ? true : false + do_getauto && (val_getauto = nothing) # If getauto=true, we want to pass a nothing to the find_histo_limits() fun do_zoom = ((find_in_dict(d, [:zoom])[1]) !== nothing) ? true : false # Automatic zoom to interesting region function if_zoom(cmd, opt_R, limit_L, limit_R, hst) From 433cc28dafe09280d497a00e4499f70914afa1e0 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Thu, 9 Apr 2026 03:52:26 +0100 Subject: [PATCH 6/7] Fix regression in vlines() --- src/plot.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plot.jl b/src/plot.jl index ebfdba8d5..b8aea47b4 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -1534,7 +1534,12 @@ function helper_vhlines(arg1, vert::Bool, first::Bool, xymin, xymax, percent, d) !isnan(xymin) && (xy[1] = !percent ? xymin : xy[1] + (xy[2]-xy[1]) * xymin) !isnan(xymax) && (xy[2] = !percent ? xymax : xy[1] + (xy[2]-xy[1]) * xymax) D::GMTdataset = mat2ds(mat, x=xy, multi=true, nanseg=true)[1] - vert && (d[:yx] = true) # Because we need to swapp x / y columns in the vlines case + #vert && (d[:yx] = true) # Because we need to swapp x / y columns in the vlines case + if (vert) + for k = 1:size(D,1) + D.data[k,1], D.data[k,2] = D.data[k,2], D.data[k,1] + end + end delete!(d, [[:xmin], [:xmax], [:ymin], [:ymax]]) common_plot_xyz("", D, "lines", first, false, d) From ca32d6941d71ff60314a68a9d17ee86311f4fcca Mon Sep 17 00:00:00 2001 From: Joaquim Date: Thu, 9 Apr 2026 03:53:28 +0100 Subject: [PATCH 7/7] Comment the xkcd include --- src/GMT.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GMT.jl b/src/GMT.jl index 455165ca0..7a6d752f6 100644 --- a/src/GMT.jl +++ b/src/GMT.jl @@ -328,8 +328,8 @@ include("trend2d.jl") include("xyz2grd.jl") include("utils.jl") include("utils_project.jl") -include("xkcd.jl") -#include("drawing/Drawing.jl") +#include("xkcd.jl") +include("drawing/Drawing.jl") include("extras/anaglyph.jl") include("extras/analemma.jl") include("extras/fourcolors.jl")