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] Colorbar colors don't match actual colors in contourf plot #4950

Open
david-macmahon opened this issue Jun 22, 2024 · 0 comments
Open
Labels

Comments

@david-macmahon
Copy link
Contributor

Details

Using specified levels with the contourf function, I get colorbar colors that don’t match the plot. This happens when using the GR backend. The Plotly/PlotlyJS backends claim not to support arbitrary contour levels, so this can't be tested with that backend. Here is an example:

julia> z = 50 .- ((-5:5).^2 .+ ((-5:5).^2)');
julia> contourf(z, levels=[0,20,30,45,50], fillcolor=:lightrainbow, clabels=true)

This produces this plot where the 20 to 30 band in the plot doesn’t have the same color as shown on the colorbar for that range:

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: Plots v1.40.4
Backend version (]st -m <backend(s)>): GR v0.73.6
Output of versioninfo():

Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
Environment:
  JULIA_EDITOR = code
  DYLD_FALLBACK_LIBRARY_PATH = [super long path with lots of Julia artifact directories elided]
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