You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log scale axis labels with a power of two symbols or more is broken
using Plots
pgfplotsx()
PGFPlotsX.latexengine!(PGFPlotsX.PDFLATEX) # doubt it's relevant, but just in case - I use itplot(
plot([1e-5, 1e10]; title="Automatic labels",
yticks=[1e-5, 1e0, 1e10]),
plot([1e-5, 1e10]; title="Manual labels",
yticks=([1e-5, 1e0, 1e10], ["\$10^{-5}\$", "\$10^{0}\$", "\$10^{10}\$"])),
legend=:none, yscale=:log10
)
Looking at the generated .tex
savefig("plot.tex")
open("plot.tex") do f
for line ineachline(f)
i0 =findfirst("yticklabels=", line)
i1 =findfirst("ytick=", line)
if!isnothing(i0)
println(line[i0[1]:i1[1]-3])
endendend
we see that the power is not wrapped automatically.
The behavior changed between v1.38.1 and v1.38.2, so I suspect #4618 was almost there - the tests only covered single-digit powers.
Details
Log scale axis labels with a power of two symbols or more is broken
Looking at the generated .tex
we see that the power is not wrapped automatically.
The behavior changed between v1.38.1 and v1.38.2, so I suspect #4618 was almost there - the tests only covered single-digit powers.
Looks like it can be fixed here
Plots.jl/src/axes.jl
Line 115 in 5f29256
by changing to
though it's a low-level function and I am not confident enough to open a PR.
Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version:
v1.38.6
Backend version (
]st -m <backend(s)>
):Output of
versioninfo()
:The text was updated successfully, but these errors were encountered: