heatmaps or kernel density estimates are indeed what you are looking for. If your domain has special boundaries or particular topologies you might want to look into heatmaps provided within DIVAnd (DIVAnd_heatmap). https://github.com/gher-ulg/DIVAnd.jl
You can increase the number of bins to reduce the granularity. But if you want it to be smooth you should make a distribution fit and 9plot the distribution with heatmap
I prefer to use Plots.jl in order to keep plot formatting (size, font, colorsâŚ). However, I am impressed of the plot speed with GR.
I explored two ways:
First one with heatmap as suggested:
#test heatmap
using KernelDensity
using Interpolations
using Plots
x = sort(randn(5000))
y = x * 2.3 + sort(randn(5000))
k = kde((x, y))
ik = InterpKDE(k)
z = pdf(ik, x, y)
heatmap(x, y, z, c = :vik)
savefig("./heatmap.png");
Second one with contourf:
#test contourf linewidth 0
using KernelDensity
using Plots
using StatsPlots
x = sort(randn(5000))
y = x * 2.3 + sort(randn(5000))
k = kde((x, y))
contourf(k,
c = :vik,
linewidth = 0)
savefig("./contourf.png");