3
$\begingroup$

This question already has an answer here:

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$

marked as duplicate by Jason B., chuy, gwr, m_goldberg, Feyre Aug 23 '16 at 20:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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$ – chuy Aug 23 '16 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.stack.imgur.com/QX56X.png $\endgroup$ – Jason B. Aug 23 '16 at 17:55
3
$\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$

Not the answer you're looking for? Browse other questions tagged or ask your own question.