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
Certain fields that contain NaNs result in rendering errors for contours with labels=true
Code setup
using CairoMakie
functionf_ex(x,y, set_nans=true)
# Define coefficients
a =1000# Overall scale
b =4# Controls the "peak" location
c =0.3# Controls the rate of decrease for large x and y# Create a surface that rises and then falls
z = a * (1- (x -0.5)^2- (y -0.3)^2- c * (x * y))
# Adjust to ensure positive values and add base level
z =max(z, 0) +200
set_nans && y >2x +0.4&&returnNaNreturn z
endfunctionmake_contour_plot(; set_nans, levels =900:50:1100)
x,y =0:0.01:0.5, 0:0.01:0.8
z =f_ex.(x,y',true)
f,a,c =contourf(x,y,z)
contour!(a,x,y,z; labels=true, color=:black, levels)
f
end
Case 1: The field has no NaNs
In this case, labels show as expected
make_contour_plot(set_nans=false)
Case 2: Set some values to NaN
In this case, the contour strikes through some of the labels
make_contour_plot(set_nans=true)
Case 3: Show fewer contours
If none of the contours intersect the NaNs, labels show as expected:
Certain fields that contain
NaN
s result in rendering errors forcontour
s withlabels=true
Code setup
Case 1: The field has no
NaN
sIn this case, labels show as expected
Case 2: Set some values to
NaN
In this case, the contour strikes through some of the labels
Case 3: Show fewer contours
If none of the contours intersect the
NaN
s, labels show as expected:]st -m Makie
)Makie v0.21.11
]activate --temp; add Makie
)The text was updated successfully, but these errors were encountered: