I have data from a simulation (test.csv.gz) and I am trying to plot it as a surface.
The equations have a singularity at a certain threshold, so there is a cutoff in the values of the surface.
The problem I am facing is that as the values are irregular near the threshold, there is a “sawtooth” at the top instead of being smooth.
Is there a way to change the algorithm used to compute the surface so it is smoother? Or some way to interpolate it before?
I could always compute more points, but I had similar problems in other occasions so I’d like to find a solution if possible.
Here is the script to reproduce it:
using CSV
using DataFrames
using GLMakie
df = DataFrame(CSV.File("test.csv.gz"))
fig = Figure()
ax = Axis3(fig[1, 1]; aspect = :equal, xlabel = "x", ylabel = "y", zlabel = "z")
cmap = categorical_colors([:blue], 1)
surface!(ax, df[!, :x], df[!, :y], df[!, :z], colormap = cmap)
scatter!(ax, df[!, :x], df[!, :y], df[!, :z], color = :black, markersize = 3)
save("test.png", fig, px_per_unit = 5)
Thanks!