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

plotting
development

#1

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?


#2

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.


#3

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

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

48%20AM
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?


#4

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
http://docs.juliaplots.org/latest/examples/pyplot/#arguments
there is an example, adding the shape in marker (with :circle). Maybe it could work for you.


#5

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.