Skip to content

[BUG] image tick positions misplaced when specifying image axes #4158

@sefffal

Description

@sefffal

Details

See #4087 and #4088, and tagging @t-bltg.

With GR, the tick positions of images are not placed correctly when the axes of the image are passed to plot:

using Images, Plots
i = rand(RGB, 10, 10)
plot(i) # Fixed by #4088
plot(1:10, 1:10, i) # Still broken

Image plot without specifying axes:

Image plot with axes specified:

It's subtle, but to match the normal behaviour of images and other backends, the +/- 5s should be at the centres of their pixels. The +/-2.5s are also slightly off.
Thanks!

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:
[91a5bcdd] Plots v1.27.0
Backend version (]st -m <backend(s)>):
[28b8d3ca] GR v0.64.0
Output of versioninfo():

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_EDITOR = code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions