# Is there a work around to make a symlog plot in Plots.jl?

**URL:** https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119
**Category:** New to Julia
**Created:** [November 25, 2025, 6:52pm UTC](https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119 "2025-11-25T18:52:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jwtkeeble](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jwtkeeble](https://discourse.julialang.org/u/jwtkeeble)
#### Post date: [November 25, 2025, 6:52pm UTC](https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119/1 "2025-11-25T18:52:51Z")

</div>

Hi All,

Is there a way to plot a histogram in Plots.jl with a `symlog` scale on the x-axis? With matplotlib, there’s a `symlog` x-scale property. However, there doesn’t seem to be one in Plots.jl? Unless I’ve missed something?

```julia-auto
using Plots

# Example data
data = rand(10_000)

# Plot histogram (transformed data)
plt = histogram(
    data,
    bins = 50,
    xscale = :symlog10
)

```

with the error,

```julia-auto
┌ Warning: scale symlog10 is unsupported with Plots.GRBackend().
│ Choose from: [:identity, :ln, :log10, :log2]
└ @ Plots ~/.julia/packages/Plots/8ZnR3/src/args.jl:1590

```

---

<div class="post-metadata">

### Author: ![jwtkeeble](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jwtkeeble](https://discourse.julialang.org/u/jwtkeeble)
#### Post date: [February 18, 2026, 5:03pm UTC](https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119/2 "2026-02-18T17:03:39Z")

</div>

Bumping this thread to see if there’s an easy way to do this that I’ve missed.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)
#### Post date: [February 18, 2026, 8:19pm UTC](https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119/3 "2026-02-18T20:19:50Z")

</div>

There’s no native way to do this in Plots, so a kludge is required.

```julia-auto
using Plots
gr()

# Define the symlog transformation function
symlog10(x, thr=1.0) = sign(x) * log10(1 + abs(x)/thr)
inv_symlog10(x, thr=1.0) = sign(x) * thr * (10^abs(x) - 1)

x = range(-100, 100, length=1000)
y = x.^3

# Transform data
y_trans = symlog10.(y)

# Generate appropriate ticks
ticks = [-10^6, -10^4, -10^2, 0, 10^2, 10^4, 10^6]
tick_labels = [string(t) for t in ticks]
tick_positions = symlog10.(ticks)

plt = plot(x, y_trans, yticks = (tick_positions, tick_labels), 
    title = "Manual Symlog Transformation", ylabel = "Log Scale (Symmetric)")
plt = plot!(plt, size = (600, 400))
savefig(plt, "symlog_plot.png")

```

 ![symlog_plot](https://global.discourse-cdn.com/julialang/original/3X/4/7/47494b8bb6d6c152cf630e05685662d7f7a2e9ba.png)

Makie, however, has a native way to do this.

```julia-auto
using CairoMakie, Makie

fig = Figure()

ax = Axis(fig[1,1], yscale = Makie.Symlog10(1.0))

x = -100:100

lines!(ax, x, sin.(x / 10), linewidth = 2)

fig

```

 ![display](https://global.discourse-cdn.com/julialang/original/3X/d/3/d322da99873014f80721d3548b1566a4f6d137ff.png)

---

<div class="post-metadata">

### Author: ![jwtkeeble](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jwtkeeble](https://discourse.julialang.org/u/jwtkeeble)
#### Post date: [February 20, 2026, 10:43am UTC](https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119/4 "2026-02-20T10:43:11Z")

</div>

Thanks for the prompt reply, @technocrat !

Do you know if this is possible with plotting a histogram with a symmetric log x-axis?

---

<div class="post-metadata">

### Author: ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)
#### Post date: [February 20, 2026, 11:16am UTC](https://discourse.julialang.org/t/is-there-a-work-around-to-make-a-symlog-plot-in-plots-jl/134119/5 "2026-02-20T11:16:23Z")

</div>

Not technically a histogram, but a barplot. The y-axis of a histogram is counts.

```julia-auto
using CairoMakie

fig = Figure()
ax = Axis(fig[1,1], yscale = Makie.Symlog10(1.0))

x = 1:20
y = [-500, 3, -80, 1200, -2, 450, -9000, 7, -150, 300,
      -1, 850, -45, 2000, 6, -700, 12, -3500, 99, -18]

barplot!(ax, x, y)
fig

```

 ![display](https://global.discourse-cdn.com/julialang/original/3X/2/1/21f47f055eae40995dcef2c08c00d8f3eee4d51a.png)
