4
$\begingroup$

I have what I think is a ParametricPlot that is no different in structure from the example for explicitly styling different curves provided in the documentation:

ParametricPlot[ReIm[z[t,#]]&/@{3,4,5}, {t, 0, 10}, PlotLegends->{"foo","bar","baz"}, PlotStyle->{Red,Blue, Green}] 

But this produces a figure with one rather than three styles and legends (oddly the last listed for the style and the first listed legend):

enter image description here

How do I get different styles and legends for each curve in my plot?

$\endgroup$
2
  • 2
    $\begingroup$ ParametricPlot has the attribute HoldAll. I suspect you will get the result you want by wrapping Evaluate around the first argument to ParametricPlot. $\endgroup$ Commented Aug 23, 2016 at 17:53
  • $\begingroup$ We don't have your definition of z, but here's an example of what chuy is talking about, using another complex function: i.sstatic.net/QX56X.png $\endgroup$ Commented Aug 23, 2016 at 17:55

1 Answer 1

4
$\begingroup$

I made up a z[t].

z[t_, i_] := i (Cos[t] + I Sin[t]) + 0.2*(Cos[3 i t] + I Sin[3 i t]) ParametricPlot[ ReIm[z[t, #]] & /@ {3, 4, 5}, {t, 0, 10}, PlotLegends -> {"foo", "bar", "baz"}, PlotStyle -> {Red, Blue, Green} ] 

Mathematica graphics

You need to wrap the Map with Evaluate.

ParametricPlot[ Evaluate[ReIm[z[t, #]] & /@ {3, 4, 5}], {t, 0, 10}, PlotLegends -> {"foo", "bar", "baz"}, PlotStyle -> {Red, Blue, Green} ] 

Mathematica graphics

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.