Skip to content

Commit c2b7699

Browse files
committed
Add :symlog_threshold
1 parent 532bb76 commit c2b7699

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [1.17.0]
44
- Add `:symlog` axis scaling for symmetric logarithmic axis scaling, see, e.g. [matplotlib symlog](https://matplotlib.org/stable/gallery/scales/symlog_demo.html)
5+
- Add `:symlog_threshold` (default = 10.0) to determine when to switch from linear to log scaling in case of `:symlog` scaling
56

67
## [1.16.3] - 2026-01-07
78
- Add `title`, `xlabel`, and `ylabel` to 1D and 2D `gridplot!` with `GLMakie`

ext/GridVisualizeMakieExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,15 @@ function scalarplot!(ctx, TP::Type{MakieType}, ::Type{Val{1}}, grids, parentgrid
477477
if ctx[:xscale] == :log
478478
xscale = log10
479479
elseif ctx[:xscale] == :symlog
480-
xscale = XMakie.Makie.pseudolog10
480+
xscale = XMakie.Makie.Makie.Symlog10(ctx[:symlog_threshold])
481481
else
482482
xscale = identity
483483
end
484484

485485
if ctx[:yscale] == :log
486486
yscale = log10
487487
elseif ctx[:yscale] == :symlog
488-
yscale = XMakie.Makie.pseudolog10
488+
yscale = XMakie.Makie.Makie.Symlog10(ctx[:symlog_threshold])
489489
else
490490
yscale = identity
491491
end

src/dispatch.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ function default_plot_kwargs()
386386
:spacing => Pair(nothing, "Removed from API"),
387387
:species => Pair(1, "Number of species to plot or number of species in regions"),
388388
:subplot => Pair((1, 1), "Private: Actual subplot"),
389+
:symlog_threshold => Pair(10.0, ":symlog threshold for switching from linear to log scaling. Only relevant for :symlog axis scaling."),
389390
:title => Pair("", "Plot title"),
390391
:tetxplane_tol => Pair(0.0, "tolerance for tet-plane intersection in 3D"),
391392
:vconstant => Pair(false, "Set all arrow length constant in vector plot"),

src/pycommon.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@ function scalarplot!(ctx, TP::Type{T}, ::Type{Val{1}}, grids, parentgrid, funcs)
438438

439439
# activate log scaling
440440
ctx[:xscale] == :log && ax.set_xscale("log")
441-
ctx[:xscale] == :symlog && ax.set_xscale("symlog")
441+
ctx[:xscale] == :symlog && ax.set_xscale("symlog", linthresh = ctx[:symlog_threshold])
442442
ctx[:yscale] == :log && ax.set_yscale("log")
443-
ctx[:yscale] == :symlog && ax.set_yscale("symlog")
443+
ctx[:yscale] == :symlog && ax.set_yscale("symlog", linthresh = ctx[:symlog_threshold])
444444

445445
pplot = ax.plot
446446

0 commit comments

Comments
 (0)