I’m finding that a plot() call with seriestype=:shape can use the wrong colour. This is on a fairly large dataset (over 50Mb) so I pared it down to the attached. The second plot gets yellow paint, not the gray paint that I expected. This does not always occur across choices of n, but it is reproducible for a given n, in my tests.
My code, setup and the plotted output are as follows.
I wonder if anyone can advise as to whether I am doing something wrong, or how I can solve the problem. (My search online suggested that I insert a plot() before the second panel, but that didn’t help.) Of course, I’d be more than happy to try other tests. For my actual work, this is not crucial, because I’m working with data and can put the plot with seriestype=:shape before the other, and things are okay then. (For anyone interested, I’m looking at ocean glider data, colourizing a pressure=pressure(time) field by a measured variable. And after that plot, I’m drawing a map of the study region. It’s the latter, with colourized land, that is why I’m using :shape.)
Code
using Plots
gr()
n = 1e5
x = 0.0:1.0:n
y = sin.(2 * pi * x / n)
z = cos.(2 * pi * x / n)
p1 = scatter(x, y, zcolor=z, color=:turbo, ms=3,
label=false, markerstrokewidth=0)
# I also tried color=:gray80 in the next, but with the same result
p2 = plot(x, y, seriestype=:shape, fillcolor=:gray80,
label=false)
plot(p1, p2, layout=(2, 1))
savefig("b.png")
Setup
Julia Version 1.13.0-rc1
Commit 58b2d6e8cb8 (2026-04-27 12:04 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: macOS (arm64-apple-darwin24.0.0)
CPU: 14 × Apple M4 Pro
WORD_SIZE: 64
LLVM: libLLVM-20.1.8 (ORCJIT, apple-m4)
GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 10 virtual cores)
Plot
