Plots.jl
Plots.jl copied to clipboard
[BUG] (x/y) mirror not work framestyle=:box and pyplot()
Details
using Plots; pyplot()
plot(rand(10); mirror=true) # works fine
plot(rand(10); mirror=true, framestyle=:box) # axes not mirrored
All other styles I tested (:semi
, :axis
) worked fine. xmirror
and ymirror
don't work either.
Backends
This bug occurs on ( insert x
below )
Backend | yes | no | untested |
---|---|---|---|
gr (default) | |||
pyplot | x | ||
plotly | |||
plotlyjs | |||
pgfplotsx | |||
inspectdr |
Versions
Plots.jl version: 1.14
Backend version (]st -m
): 2.9.0
Output of versioninfo()
:
julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
I saw in the backend code that apparently this is actively set to not work
if sp[:xaxis][:mirror]
ax.xaxis."set_label_position"("top") # the guides
sp[:framestyle] == :box ? nothing : ax.xaxis."tick_top"()
end
if sp[:yaxis][:mirror]
ax.yaxis."set_label_position"("right") # the guides
sp[:framestyle] == :box ? nothing : ax.yaxis."tick_right"()
end
Perhaps you could play around and come up with a robust solution? I've written that as of an todo item for future. I could not come up with an easy solution for this case.
What is preventing just enabling ax.xaxis."tick_top"()
and ax.yaxis."tick_right"()
for :box
as well? I get
julia> plot(plot([1,2,3]), plot([1,2,3]; mirror=true, ylabel="abc", border=:box))
on master.