We could add some basic visualization routines using Plots.jl (and create a documentation section about it).
scatter(data_points[1, :], data_points[2, :], legend=false, title="points")
for element in axes(vertices, 2)
v1 = vertices[1, element]
v2 = vertices[2, element]
v3 = vertices[3, element]
x1 = data_points[:, v1]
x2 = data_points[:, v2]
x3 = data_points[:, v3]
plot!(p, [x1[1], x2[1]], [x1[2], x2[2]])
plot!(p, [x2[1], x3[1]], [x2[2], x3[2]])
plot!(p, [x3[1], x1[1]], [x3[2], x1[2]])
end
plot!(title = "triangles")
p1 = scatter(data_points[1, :], data_points[2, :], legend=false)
for element_vor in axes(voronoi_vertices_interval, 2)
vertex_first = voronoi_vertices_interval[1, element_vor]
vertex_last = voronoi_vertices_interval[2, element_vor]
for i in vertex_first:(vertex_last-1)
v1 = voronoi_vertices[i]
v2 = voronoi_vertices[i + 1]
x1 = voronoi_vertices_coordinates[:, v1]
x2 = voronoi_vertices_coordinates[:, v2]
plot!(p1, [x1[1], x2[1]], [x1[2], x2[2]])
end
v1 = voronoi_vertices[vertex_last]
v2 = voronoi_vertices[vertex_first]
x1 = voronoi_vertices_coordinates[:, v1]
x2 = voronoi_vertices_coordinates[:, v2]
plot!(p1, [x1[1], x2[1]], [x1[2], x2[2]], title="mesh type: $mesh_type")
end
The variables names are chosen as in the elixirs.