Plots.jl: Assigning seriescolor using ColorGradient for line plot

Eh, plot(X, palette = :inferno) is already valid Plots syntax?

Note that Plots cannot know how many series you will add in the future, so when specifying a palette it will always try to select each color to be as widely spaced on the color gradient as possible.
If you know you have 5 series and want them spaced on the color gradient sequentially, you can use color and spread line_z over the 5 series:
plot(rand(20,5), color = :RdYlBu, line_z = (1:5)')


You can also just supply a vector with the color of each line to palette.

2 Likes