Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
创建绘图后如何访问绘图的属性?
例如,我希望从绘图中获得 y 轴限制。像这样的东西不起作用:
p1 = Plots.plot(rand(10)) get(p1,:ylim)
这个错误:
MethodError: no method matching get(::Plots.Plot{Plots.GRBackend}, ::Symbol)
情节被组织成子情节(通常只有一个),这些子情节被组织成系列。在这种情况下,您需要 y 轴范围,这是子图的函数。通常,您可以通过以下方式y从第一个子图中的第一个系列中获取命名属性(例如)
y
p1[1][1][:y]
在限制的情况下,它有点复杂,它们是Axis子图所拥有的属性。但幸运的是你可以做到
Axis
ylims(p1)