You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raised this issue on Slack but since it looks like there is a bug somewhere (actually possibly multiple bugs), it's probably better to start an issue here. MWE:
x =tan.(atan(-3):0.1:atan(3))
y =collect(-2.5:0.1:2.5)
peaks(x,y) =3*(1-x)^2*exp(-(x^2) - (y+1)^2) -10*(x/5- x^3- y^5) *exp(-x^2-y^2) -1/3*exp(-(x+1)^2- y^2)
z = [peaks(x,y) for y in y, x in x]
using AbstractPlotting
using AbstractPlotting.MakieLayout
using GLMaki
scene, layout =layoutscene()
display(scene)
ax = layout[1,1] =LAxis(scene)
heatmap!(ax,x,y,z)
contour!(ax,x,y,z,color=:black)
using Plots
Plots.heatmap(y,x,z')
Plots.contour!(y,x,z',color=:black)
which spits out a heatmap with overlaid contours of the peaks function, with an irregularly spaced x. Plots (GR) output on the left and Makie output on the right:
I see a number of problems with Makie:
The contours and heatmap are not aligned.
The contours are jumping around
Both the heatmap and contours don't handle the irregular x
BTW, I'm not saying Plots is perfect (e.g., it's not showing the "top" most layer, which you can see because the y axis does not go above ≈2.3 despite there being a y=2.5 value), but I think Makie's output is really far off here.
I'm not sure how I can help, please let me know! 🙂 (I would really like to use MakieLayout for some publication-quality plots that I need very soon and use heatmaps and contours)
The text was updated successfully, but these errors were encountered:
So it turns out that for regularly spaced grids, swapping the orientation of z does the trick (thanks Staffan Hellström on Slack). MWE [EDITED (copied the wrong snippet earlier)]:
x =-3:0.1:3
y =-2.5:0.1:2.5peaks(x,y) =3*(1-x)^2*exp(-(x^2) - (y+1)^2) -10*(x/5- x^3- y^5) *exp(-x^2-y^2) -1/3*exp(-(x+1)^2- y^2)
z = [peaks(x,y) for x in x, y in y]
using AbstractPlotting
using AbstractPlotting.MakieLayout
using GLMakie
scene, layout =layoutscene()
display(scene)
ax = layout[1,1] =LAxis(scene)
heatmap!(ax,x,y,z)
contour!(ax,x,y,z,color=:black)
gives
I'll open a separate issue for the irregularly spaced grids.
I raised this issue on Slack but since it looks like there is a bug somewhere (actually possibly multiple bugs), it's probably better to start an issue here. MWE:
which spits out a
heatmap
with overlaidcontour
s of thepeaks
function, with an irregularly spacedx
. Plots (GR) output on the left and Makie output on the right:I see a number of problems with Makie:
x
BTW, I'm not saying Plots is perfect (e.g., it's not showing the "top" most layer, which you can see because the y axis does not go above ≈2.3 despite there being a
y=2.5
value), but I think Makie's output is really far off here.I'm not sure how I can help, please let me know! 🙂 (I would really like to use MakieLayout for some publication-quality plots that I need very soon and use heatmaps and contours)
The text was updated successfully, but these errors were encountered: