如何让PlotLegend在Mathematica中使用ParametricPlot?

时间:2011-10-02 01:59:47

标签: wolfram-mathematica plot

我似乎无法将PlotLegendParametricPlot一起使用。这是我试过的:

ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 2 Pi}, 
 PlotLegend -> {"My Plot"}] 

1 个答案:

答案 0 :(得分:5)

如果您先调用PlotLegends软件包,它应该可以正常工作,尽管您可能更好地使用ShowLegends版本而不是PlotLegend选项,以获得更多控制权:

Needs["PlotLegends`"]

ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 2 Pi}, 
 PlotLegend -> {"My Plot"}]

enter image description here

ShowLegend[
 ParametricPlot[{Sin[t], Cos[Sqrt[t]]}, {t, 0, 
   2 Pi}], {{{Graphics[{Blue, Disk[{0, 0}, 1]}], {Sin[t], 
     Cos[Sqrt[t]]}}}}]

enter image description here

相关问题