When plotting a contour plot of a quadratic, behaviour is different for Plots and Makie, while Makie is correct. The motivation is to show an iteration of the Newton method.
MWE
using Plots, GLMakie
using LinearAlgebra
x1_grid = -1:0.02:1
x2_grid = -1:0.02:1
xk = [0.7, 0.5]
f(x) = (x[1]+1)^4 + x[1]*x[2] + (x[2]+1)^4
∇f(x) = [4(x[1]+1)^3+x[2], x[1]+4(x[2]+1)^3]
∇²f(x) = [12(x[1]+1)^2 1;1 12(x[2]+1)^2]
m(x) = f(xk)+dot(∇f(xk),x-xk) + 1/2*dot(x-xk, ∇²f(xk), x-xk)
x_kp1 = xk - ∇²f(xk) \ ∇f(xk)
m_grid = [m([x1, x2]) for x1=x1_grid, x2=x2_grid]
Plots.contour(x1_grid, x2_grid, m_grid)
Plots.scatter!([x_kp1[1]], [x_kp1[2]])
fig = Figure()
Axis(fig[1,1])
GLMakie.contour(x1_grid, x2_grid, m_grid)
GLMakie.scatter!([x_kp1[1]], [x_kp1[2]])
Makie correctly shows the minimizer in the center of the ellipses while the Plots package is off. Am I doing something wrong?