Mathematica v8 で PlotLegend を使用して、凡例付きの関数のリストをプロットしようとしています。私がやろうとしていることを示す簡単なテストとして。
<<PlotLegends`
test = Table[f[x], {f, {Sin, Cos, Tan, Log, Exp}}]
Plot[test, {x, 0, 1}, PlotRange -> Full, Axes -> {True, False},
PlotStyle -> Thick, AxesOrigin -> {0, 0},
PlotLegend -> {"Sin", "Cos", "Tan", "Log", "Exp"},
LegendPosition -> {0, -0.5}, LegendShadow -> None]
出力として与える
{Sin[x], Cos[x], Tan[x], Log[x], E^x}
ただし、表を明示的に Plot コマンドに入れると、正しい凡例が得られます。
Plot[{Sin[x], Cos[x], Tan[x], Log[x], Exp[x]}, {x, 0, 1},
PlotRange -> Full, Axes -> {True, False}, PlotStyle -> Thick,
AxesOrigin -> {0, 0},
PlotLegend -> {"Sin", "Cos", "Tan", "Log", "Exp"},
LegendPosition -> {0, -0.5}, LegendShadow -> None]
私の実際のアプリケーションでは、Do ループ内に関数のリストをまとめているので、後者の Plot コマンドは理想的ではありません。
どんな提案でも大歓迎です。
乾杯、マイク