symlog

symlog(x, y; axis=:y, linthresh=1, linscale=1, base=10, kwargs...)

Plot data with a symmetric logarithmic scale, like matplotlib’s symlog. The scale is linear in the range [-linthresh, linthresh] and logarithmic beyond, allowing visualization of data that spans many orders of magnitude including negative values and zero.

symlog(x::AbstractVector, y::AbstractVector; axis=:y, linthresh=1, kwargs...)

Plots vectors x and y applying the symlog transform to the axis specified by axis.

symlog(D::GMTdataset; axis=:y, linthresh=1, kwargs...)

Plots a GMTdataset applying the symlog transform.

symlog(D::Vector{<:GMTdataset}; axis=:y, linthresh=1, kwargs...)

Plots multiple datasets, each with the symlog transform applied.

The inverse transform is available via isymlog(y; linthresh, linscale, base) to convert transformed values back to the original scale.

This module is a subset of plot. So not all (fine) controlling parameters are not listed here. For the finest control, user should consult the plot module.
Parameters

Examples

A curve spanning several orders of magnitude in both positive and negative directions. The symlog scale compresses the extremes while keeping a linear region near zero.

using GMT
x = collect(range(1.0, 100.0, length=500))
y = @. 10.0^(x/20) - 10.0^((101-x)/20)
symlog(x, y, linthresh=10, lw=1, show=true)

Apply the symlog transform to the X axis instead of Y.

using GMT
x = collect(range(1.0, 100.0, length=500))
y = @. 10.0^(x/20) - 10.0^((101-x)/20)
symlog(y, x, axis=:x, linthresh=10, lw=1, show=true)

Apply the symlog transform to both axes.

using GMT
x = collect(range(-500.0, 500.0, length=1000))
y = @. x^3 / 1000
symlog(x, y, axis=:xy, linthresh=5, lw=1, show=true)

Source Code

This function has multiple methods: