# How to not show line mesh elements

Let's say I make a mesh from a collection of random points:

SeedRandom[1234]
points = RandomReal[1, {20, 2}];
mesh = VoronoiMesh[points]


For the purposes of my question we can just make an automatic highlighting of each cell (I want the colors of each cell to be different):

HighlightMesh[mesh, Table[{2, {i}}, {i, 20}]]


I want to be able to take the colored mesh and remove the edges between each "cell" so that it essentially goes from one color to the next. Of course, I could just color each edge the same color as a cell it is touching, but that seems to be inefficient, especially if there is a quick way to remove the edges. I can't seem to find a way to just make the edges non-existent in the drawing of the mesh. From what I have been looking up, it seems like there is a lot of undocumented things you can do with meshes, and even if something is documented it is difficult to find what you are looking for sometimes since the information of meshes in Mathematica is so extensive.

UPDATE The answer so far works for the color mesh I posted, but what if my cells are darker in color? In this case changing the Opacity doesn't quite do the trick.

Opacity set to 0 for edges:

Use the MeshCellStyle option:

SeedRandom[1234]
points = RandomReal[1, {20, 2}];
mesh = VoronoiMesh[points, MeshCellStyle->{1->Opacity[0]}];

HighlightMesh[mesh, Table[{2, {i}}, {i, 20}]]


or:

SeedRandom[1234]
points = RandomReal[1, {20, 2}];
mesh = VoronoiMesh[points];

MeshRegion[
HighlightMesh[mesh, Table[{2, {i}}, {i, 20}]],
MeshCellStyle->{1->Opacity[0]}
]


I think for gray scale images, the lines you are seeing are an antialiasing artefact. If you turn off antialiasing, the line color should be suppressed, but they will be very jagged:

HighlightMesh[
mesh,
Table[Style[{2,i}, GrayLevel[RandomReal[.5]]], {i, 20}],
MeshCellStyle -> {1 -> Directive[Opacity[0], Antialiasing->False]}
]


• What if the cells are darker in color (closer to black)? I might edit my example to use graylevels Jan 31, 2019 at 17:39
• @AaronStevens that shouldn't change anything. Carl just made the boundaries disappear. Jan 31, 2019 at 19:11
• @b3m2a1 I edited the question to show an example with darker colors. You can still see light borders around the dark cells Jan 31, 2019 at 20:01
• Huh yeah I guess it is the antialiasing for the darker ones. The actual meshes I will be using have smaller cells, so maybe the jagged edges won't be as noticable. Feb 1, 2019 at 2:29