Plots.jl icon indicating copy to clipboard operation
Plots.jl copied to clipboard

[BUG] Wide plot sizes break the placement of axis tick labels and guides and the legend geometry

Open LRBaalmann opened this issue 2 years ago • 1 comments

Details

When using wide plot sizes (e.g. size=(6000,400) instead of the default (600,400)), all other horizontal margins increase to ridiculous sizes as well, including the padding between axes and labels (of both ticks and guide), the padding and line width in the legend, and the padding of xwiden. Furthermore, the vertical padding between the x-axis and its labels increases as well, pushing the labels out of the canvas.

An example plot is attached, generated by plot(rand(500), size=(6000,400), xguide="x", yguide="y", title="title")

wideplot

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: v1.31.7 Backend version (]st -m <backend(s)>): v0.66.2 Output of versioninfo(): Julia Version 1.8.0 Commit 5544a0fab76 (2022-08-17 13:38 UTC) Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake) Threads: 1 on 8 virtual cores Environment: LD_LIBRARY_PATH = /home/lrb/intel/oneapi/mpi/2021.5.1//libfabric/lib:/home/lrb/intel/oneapi/mpi/2021.5.1//lib/release:/home/lrb/intel/oneapi/mpi/2021.5.1//lib:/home/lrb/intel/oneapi/debugger/2021.5.0/gdb/intel64/lib:/home/lrb/intel/oneapi/debugger/2021.5.0/libipt/intel64/lib:/home/lrb/intel/oneapi/debugger/2021.5.0/dep/lib:/home/lrb/intel/oneapi/compiler/2022.0.2/linux/lib:/home/lrb/intel/oneapi/compiler/2022.0.2/linux/lib/x64:/home/lrb/intel/oneapi/compiler/2022.0.2/linux/compiler/lib/intel64_lin::/home/lrb/Codes/cdf/cdfjava/lib:/home/lrb/Codes/cdf/lib JULIA_EDITOR = code JULIA_NUM_THREADS =

LRBaalmann avatar Aug 22 '22 14:08 LRBaalmann

Just a small update: this issue also occurs when plotting many ordinary sized plot on a (somewhat) wide canvas:

p0 = plot(rand(100), title="Plot 0", scale=:log10)
p1 = plot(rand(100), title="Plot 1", scale=:log10)
p2 = plot(rand(100), title="Plot 2", scale=:log10)
p3 = plot(rand(100), title="Plot 3", scale=:log10)
p4 = plot(rand(100), title="Plot 4", scale=:log10)
p5 = plot(rand(100), title="Plot 5", scale=:log10)
p6 = plot(rand(100), title="Plot 6", scale=:log10)
p7 = plot(rand(100), title="Plot 7", scale=:log10)
p8 = plot(rand(100), title="Plot 8", scale=:log10)
p9 = plot(rand(100), title="Plot 9", scale=:log10)
plot(p0,p1,p2,p3,p4,p5,p6,p7,p8,p9, layout=(2,5), size=(1800,600))

error_manyplots

(Tested for Plots.jl version v1.39.0, GR version v0.72.8, Julia Version 1.9.2.)

LRBaalmann avatar Nov 16 '23 17:11 LRBaalmann