作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我设置了一个简短的程序来使用 Manipulate 显示具有不同参数的相同函数的三个图。我想用参数的值标记每个函数。我的出发点是让一个传奇人物出现。在绘图中添加 PlotLegend 会导致 Mathematica 变得异常缓慢。
我的代码是:
Needs["PlotLegends`"]
Manipulate[
UemaxOverUe = ((VA/Vphs)^2 (2 p - 1) + 1 - Ves0/Vphs - 2)/((VA/Vphs)^2 - (1 - Ves0/Vphs));
UemaxOverUe2 = ((VA/Vphs)^2 (2 p - 1) + 1 - Ves02/Vphs - 2)/((VA/Vphs)^2 - (1 - Ves02/Vphs));
UemaxOverUe3 = ((VA/Vphs)^2 (2 p - 1) + 1 - Ves03/Vphs - 2)/((VA/Vphs)^2 - (1 - Ves03/Vphs));
ListPlot[{
Table[{Vphs/VA, 1/UemaxOverUe}, {Vphs, .001 VA, VA, .01 VA}],
Table[{Vphs/VA, 1/UemaxOverUe2}, {Vphs, .001 VA, VA, .01 VA}],
Table[{Vphs/VA, 1/UemaxOverUe3}, {Vphs, .001 VA, VA, .01 VA}]},
AxesLabel -> {"Vphs/VA", "Ne/NeMax"}, Joined -> True(*,
PlotLegend->{"Blah","Blarg","Word"}*)],
{{p, 1}, 0, 5},
{{Ves0, -2 VA}, -10 VA, 10 VA, .1 VA},
{{Ves02, -2 VA}, -10 VA, 10 VA, .1 VA},
{{Ves03, -2 VA}, -10 VA, 10 VA, .1 VA}
]
PlotLegend
应该重现问题。
最佳答案
问题似乎是 PlotLegend 很慢。它与 Manipulate
没有任何关系.在我的电脑上 ListPlot
如果没有图例,则需要 0.013 秒,如果添加图例,则需要 0.43 秒。
作为一种解决方法,您可以使用
ControlActive[{}, PlotLegend -> {"Blah", "Blarg", "Word"}]]
PlotLegend
仅在您不移动 slider 时显示图例。
关于wolfram-mathematica - PlotLegends 使 Manipulate[] 图形缓慢爬行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8189742/
我设置了一个简短的程序来使用 Manipulate 显示具有不同参数的相同函数的三个图。我想用参数的值标记每个函数。我的出发点是让一个传奇人物出现。在绘图中添加 PlotLegend 会导致 Math
我使用的 Mathematica 8 副本无法识别 Plot 和 ListPlot 的 PlotLegend 选项。具体来说,使用时它会呈现红色。 快速在线搜索没有发现任何错误/异常,所以我想知道问题
看来我不能使用 PlotLegend与 ParametricPlot .这是我尝试过的: ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 2 Pi}, P
我是一名优秀的程序员,十分优秀!