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

**URL:** <https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068>\
**Category:** New to Julia\
**Tags:** plotting, graphics\
**Created:** [October 19, 2019, 3:29am UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068 "2019-10-19T03:29:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [October 19, 2019, 3:29am UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/1 "2019-10-19T03:29:39Z")

</div>

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.

 ![37%20PM](https://global.discourse-cdn.com/julialang/original/3X/1/4/1407f456358a9864d290c58a0f2b3c417d0754fb.png)

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

Thanks!

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [February 12, 2020, 1:36am UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/3 "2020-02-12T01:36:07Z")

</div>

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.

 ![Screen Shot 2020-02-11 at 7.28.31 PM](https://global.discourse-cdn.com/julialang/original/3X/1/2/121da2dee7c678a1014380021a95dc85cc05d8a0.png) ![Screen Shot 2020-02-11 at 7.28.43 PM](https://global.discourse-cdn.com/julialang/original/3X/e/e/ee10fe6b7d10e9681a91fe323810cc667f315732.png)

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

 ![Screen Shot 2020-02-11 at 7.31.35 PM](https://global.discourse-cdn.com/julialang/original/3X/b/d/bd2e3cef66d209d38ed6ec9a7bcd9ff5c222baa5.png)

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!

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [February 13, 2020, 6:14pm UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/4 "2020-02-13T18:14:16Z")

</div>

Try setting `markerstrokewidth` to 0?

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [February 13, 2020, 6:23pm UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/5 "2020-02-13T18:23:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [February 13, 2020, 6:31pm UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/6 "2020-02-13T18:31:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [February 13, 2020, 6:45pm UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/7 "2020-02-13T18:45:34Z")

</div>

> [@asinghvi17](#):
>
> 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](http://docs.juliaplots.org/latest/pipeline/) produces a [figure with large overlapping markers](http://docs.juliaplots.org/latest/examples/img/pipeline/pipeline_2.png), whereas when I try the following code

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

```

I get markers separated by white halos

 ![Screen Shot 2020-02-13 at 12.44.15 PM](https://global.discourse-cdn.com/julialang/original/3X/f/e/feaae498a5aa7b3e5584e2ea7bba3d5a5d061422.png)

---

<div class="post-metadata">

**Author:** ![josephmarturano](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@josephmarturano](https://discourse.julialang.org/u/josephmarturano)\
**Post date:** [February 13, 2020, 8:05pm UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/8 "2020-02-13T20:05:22Z")

</div>

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:

```julia
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:

 ![marker_border_test](https://global.discourse-cdn.com/julialang/original/3X/8/4/840ca8d69190be7312747f1d26f694925bd8ebe0.png)

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [February 13, 2020, 8:51pm UTC](https://discourse.julialang.org/t/how-to-remove-shape-outlines-in-a-scatter-plot/30068/9 "2020-02-13T20:51:21Z")

</div>

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.

 ![Screen Shot 2020-02-13 at 2.50.10 PM](https://global.discourse-cdn.com/julialang/original/3X/5/b/5ba989952b0d315fde5cce0dac28968bce6fd9a1.png)

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…
