绘制函数列表时使用ReplaceAll
问题描述:
当函数列表被ReplaceAll作为目标时,每个函数的PlotStyle都会丢失。绘制函数列表时使用ReplaceAll
实例具有默认属性:
GraphicsGrid[{{
Plot[{[email protected]@t, [email protected]@t}, {t, 0, Pi}],
Plot[{[email protected]@t, [email protected]@t} /. {s -> Sin, c -> Cos}, {t, 0, Pi}]
}}]
例带有自定义属性:
GraphicsGrid[{{
Plot[{[email protected]@t, [email protected]@t}, {t, 0, Pi}, PlotStyle -> {Dashed, {Red, Dotted}}],
Plot[{[email protected]@t, [email protected]@t} /. {s -> Sin, c -> Cos}, {t, 0, Pi},
PlotStyle -> {Dashed, {Red, Dotted}}]
}}]
这是因为这样的情节实际上绘制之前探索它的参数。
指定函数的各个PlotStyle属性的最优雅的方法是什么,如果可能的话,在未指定PlotStyle时重新获得默认属性?
注:
当然做
Plot[{f1 /. replist, f2 /. replist ....} ..]
不被认为是 “优雅”:d
答
我可能会只使用两种:
Plot[{[email protected]@t, [email protected]@t} /. {s -> Sin, c -> Cos} // Evaluate, {t, 0, Pi}]
或者:
Plot[#, {t, 0, Pi}] &[{[email protected]@t, [email protected]@t} /. {s -> Sin, c -> Cos}]
我们不是以前来过这里? – 2011-05-05 00:17:55
@Mr。我想是的,但我找不到它 – 2011-05-05 00:19:20
好吧,让我看看 – 2011-05-05 00:19:54