How to make colors faint/transparent when plotting a color plane using Plots?

Hello,
I want to plot a colour plane using plots, e.g.

using Plots
plot([RGB{Float64}(0.0,0.0,1.0) RGB{Float64}(1.0,0.0,0.0); RGB{Float64}(1.0,0.0,0.0) RGB{Float64}(1.0,0.0,0.0)])

image

Is there a way to make this faint/transparent (I then want to plot stuff above, so would be better if this was fainter). I have tried various alpha, markeralpha, linealpha, fillalpha without success.

You can use RGBA and set alpha as last parameter:

plot([RGBA{Float64}(0.0,0.0,1.0,0.5) RGBA{Float64}(1.0,0.0,0.0,0.5); RGBA{Float64}(1.0,0.0,0.0,0.5) RGBA{Float64}(1.0,0.0,0.0,0.5)])
2 Likes

Thanks!