Contour.jl icon indicating copy to clipboard operation
Contour.jl copied to clipboard

contour label in Contour.jl

Open raman-maker opened this issue 1 year ago • 1 comments

How to add contour labels in plot while using Contour.jl package? My code is shown below:

for cl in Contour.levels(Contour.contours(x, z, z_log, 10)) lvl = Contour.level(cl) # the z-value of this contour level for line in Contour.lines(cl) xs, ys = Contour.coordinates(line) # coordinates of this line segment lines!(ax, xs, ys, color=lvl, colorrange=ctrange, colormap=:jet) #text!(ax,position=Point2f0(mean(xs), mean(ys)), string(round(lvl, digits=2)), align = (:center, :center)) end end

raman-maker avatar Jan 20 '25 06:01 raman-maker

This functionality is outside the scope of this package. It just calculates contour lines, plotting is done by other packages.

tpapp avatar May 27 '25 14:05 tpapp