Different behavior of zcolor in Scatter and Plot

#1

Hello,
I noticed that I can change the color of markers easily in Scatter, but not in Plots.
Here an example:

using Plots

x = 1:0.1:10
y1 = x .+ 1
y2 = x .+ 2
y3 = x .+ 3

scatter(x, y1, color=:reds, zcolor=1)
scatter!(x, y2, color=:reds, zcolor=2)
scatter!(x, y3, color=:reds, zcolor=3)

plot(x, y1, color=:reds, zcolor=1)
plot!(x, y2, color=:reds, zcolor=2)
plot!(x, y3, color=:reds, zcolor=3)

Here, the results
scat
plot

Is this intentional ? :thinking::thinking:

0 Likes

#2

I don’t know if it’s directly intentional, but it’s by design. zcolor is an alias for marker_z. Use line_z to control the color of a line.

0 Likes