Here is something, I think Makie still cannot do. Here is a challenge for anyone to reproduce this kind of graphics in Makie
This isnāt the same but Iād be surprised if you couldnāt produce your plot in Makie.jl:
Code (from April '20):
using ForwardDiff
using Makie # v0.10.0
using StatsMakie # v0.2.3
f(x,y) = -5*x*y*exp(-x^2-y^2)
x = -1:0.1:1.0
y = -1:0.1:1.0
z = [f(i,j) for i in x, j in y]
xy = [(i,j) for i in x for j in y]
# This is the same function as above, just modified so that it will work with ForwardDiff
g(x,y) = [-5*x*y*exp(-x^2-y^2)]
# Jacobians are scaled by 0.05 so that the vector arrows aren't too long when plotted
J = .05 .* [ForwardDiff.jacobian(x -> g(x[1], x[2]), [i[1],i[2]]) for i in xy]
# All the x coordinates
xs = [xy[i][1] for i in 1:length(xy)]
# All the y coordinates
ys = [xy[i][2] for i in 1:length(xy)]
# We need u,v for the quiver plot
u = [J[i][1] for i in 1:length(J)]
v = [J[i][2] for i in 1:length(J)]
scene = surface(x,y,z)
xm, ym, zm = minimum(scene_limits(scene))
contour!(scene, x, y, z, levels = 15, linewidth = 2, transformation = (:xy, zm))
arrows!(xs,ys,u,v, arrowsize=0.025, linewidth=0.5, transformation = (:xy, zm))
wireframe!(scene, x, y, z, overdraw = true, transparency = true, color = (:black, 0.1))
center!(scene) # center the Scene on the display
EDIT:
I had to cheat by increasing the z values to get the contour lines on top of the surface, hopefully thereās a better way to do that (because thereās a noticeable space ). The code is mostly the same as above, just a few changes:
scene = surface(x,y,z)
xm, ym, zm = minimum(scene_limits(scene))
contour3d!(scene, x, y, z .+ 0.04, levels = 15, linewidth = 2, color=(:black, 0.5))
wireframe!(scene, x, y, z, overdraw = true, transparency = true, color = (:black, 0.1))