英文:
Julia, how to plot behind previous plot (how to push a plot to the backgrown of another plot)
问题
lineplot2
出现在 lineplot
的顶部,也就是红色的点出现在蓝线的上方,在某些点上会遮挡蓝线。
如何将红点“推送”到它们出现在蓝线的后面?
英文:
I'm plottiong a sin and a cos function with the following code:
using GLMakie
x = range(0, 10, length=100)
figure, axis, lineplot = lines(x, sin)
lineplot2 = scatter!(x, cos, color = :red)
figure
lineplot2
appears on top of lineplot
, that is, the red dots appear on top of the blue line, effectively masking the blue line at some points.
How do I "push" the red dots so that they appear behind the blue line?
答案1
得分: 1
使用 translate!
函数找到如何执行此操作。
using GLMakie
x = range(0, 10, length=100)
figure, axis, lineplot = lines(x, sin)
lineplot2 = scatter!(x, cos, color = :red)
translate!(lineplot2, 0, 0, -1)
figure
英文:
found how to do it by using translate!
using GLMakie
x = range(0, 10, length=100)
figure, axis, lineplot = lines(x, sin)
lineplot2 = scatter!(x, cos, color = :red)
translate!(lineplot2, 0, 0, -1)
figure
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论