在Makie中多次绘图(例如在for循环中)时,如何避免轴中的重叠元素?
例如,这里我想展示许多密度线,但是y轴有重叠的元素。为什么会发生这种情况,我如何防止它发生?
f = Figure()
for i in 1:10
ax = Axis(f[1, 1])
density!(rand(20), color = (:red, 0.0),
strokecolor = :red, strokewidth = 1, strokearound = false)
xlims!(0.0,1.0)
end
f生产:

发布于 2022-10-09 20:15:58
创建一次轴并将其用作density!的第一个参数
f = Figure()
ax = Axis(f[1, 1])
xlims!(ax, 0.0, 1.0)
for i in 1:10
density!(ax, rand(20), color = (:red, 0.0),
strokecolor = :red, strokewidth = 1, strokearound = false)
end
fhttps://stackoverflow.com/questions/74008053
复制相似问题