How to remove "shape" outlines in a scatter plot?

I have matrices which contain x,y,z data on a triangular grid. In other words, each column of x,y,z correspond to points on a different triangle, so that when you plot the matrices together, they give a surface plot over the entire grid.

I can produce a surface plot using “scatter(x,y,z,zcolor=z,camera=(0,90))”, but end up with outlines of the triangles in the plot.

Does anyone know how to get rid of these? I’m using Plots with the GR backend.

Thanks!

This phenomena appears to be related to whitespace around markers when using the GR() plots backend. Since it’s unstructured data, I’m using scatter with settings

gr(size=(300,300),legend=false,markerstrokewidth=0,markersize=3)

If I use scatter with zcoloring, there are whitespace “halos” around the markers.

Increasing the number of points makes these whitespace halos even more noticable.

I haven’t found a way to remove this in GR docs yet, but am looking for one. If anyone has any suggestions, I’d love to hear!

Try setting markerstrokewidth to 0?

Unfortunately, this is with markerstrokewidth=0 - seems like the white ring around each marker is there independently of markerstrokewidth.

Perhaps you could hack around this with transparency, by setting markerstrokecolor = Colors.RGBA(0, 0, 0, 0)?

Thanks for the recommendation! Unfortunately, the plot remains the same. I tried also changing markerstrokealpha=0, but this doesn’t change the plot.

I wonder if there’s something peculiar about my install of GR (I’m using Julia 1.2 with Atom/Juno). Step 2 of the Julia plots tutorial produces a figure with large overlapping markers, whereas when I try the following code

using Plots
x = randn(1000)
plot(x,markersize=30,markershape=:circle)

I get markers separated by white halos

It might be a version issue. I remember seeing white borders with a recent edition of Plots.jl; maybe 0.28.4? I remember I could not change the white border regardless of what I did.

But using Julia 1.3.0, Plots 0.29.1, and GR 0.46.0 and the following code:

using Plots
gr(size=(1000,1000),legend=false,markerstrokewidth=0,markersize=30)
x = randn(1000);
testplot = scatter(x,markershape=:circle, legend=false);
savefig(testplot, "marker_border_test.png")

I do not see borders around the circle markers:

1 Like

Thank you - that’s great to know! I’m using the same version of Plots and GR, but Julia 1.2.

I just downloaded and tried Julia 1.3. Using Plots and GR(), I also didn’t see borders around the markers.

Weird edit: I updated Atom/Juno and it removed this issue as well! I don’t get whitespace around plot markers using Julia 1.2 now…