How to get empty markers, Plots, gr() backend



If I have something like this

plot(x, y, shape = :rect, m = (5, :black, stroke(1, :red))

the second option in m fills my marker with that color. But what I want is an empty marker, not white. Empty! Is this possible here?


You can’t - it’s a weakness of the current gr backend to Plots. The other backends will do this if you set markeralpha = 0.


Too bad. I really like gr. However, if I change to pyplot, i.e.

using Plots
data = rand(10,2)
plot(data[:,1], data[:,2], m = (8, 0.0, :red, stroke(1, :blue)), 
    framestyle=:box, grid = false, size = (400,400))

where now the second option in m is the markeralpha = 0, it turns out that the label is not right. The label should be a circle (the stroke) and a line. Any ideas?


I am not actually sure about that are you looking for. I guess when you talk about label you want to say legend. In that case, in
there is an example, adding the shape in marker (with :circle). Maybe it could work for you.


Yes, I mean legend. The problem is that if you set in the example that you mention the

markeralpha =0

then the whole marker goes away in the legend. Ideally I will hope to see just the stroke and the corresponding line.