Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Plotting images inserts unwanted padding #4948

Open
orswan opened this issue Jun 19, 2024 · 0 comments
Open

[BUG] Plotting images inserts unwanted padding #4948

orswan opened this issue Jun 19, 2024 · 0 comments
Labels

Comments

@orswan
Copy link

orswan commented Jun 19, 2024

Details

When plotting multiple images, there appears white space in between the images. Simple example:

using Plots, Images
imgs = [zeros(Gray{Float64},64,128) for i=1:4]
plotParams = Dict(
    :size => (800,400),
    :layout => grid(1,4),
    :grid => false)
p = plot([plot(i',aspect_ratio=1,axis=false,size=(800,400)) for i in imgs]...; plotParams...)

Output:
annotation_test_2024-6-19

This is fine as default behavior, but there doesn't seem to be a way to eliminate it. If I try e.g. adding negative margins, the images end up on top of each other. Example:

using Plots, Images
imgs = [zeros(Gray{Float64},64,128) for i=1:4]
plotParams = Dict(
    :size => (800,400),
    :layout => grid(1,4),
    :left_margin => (-15.0,:mm),
    :grid => false)
p = plot([plot(i',aspect_ratio=1,axis=false,size=(800,400)) for i in imgs]...; plotParams...)

Output:
image

Backends

This bug occurs on ( insert x below )

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

Versions

Plots.jl version: v1.40.4
Backend version (]st -m <backend(s)>): v0.72.8

Output of versioninfo():

Julia Version 1.10.3
Commit 0b4590a550 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × 12th Gen Intel(R) Core(TM) i5-12450H
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 12 virtual cores)
@orswan orswan added the bug label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant