1

I want to PlotLegends -> "Expressions" for G with different colors where

G = {{Sqrt[1 - x] + I Sqrt[x]}, {Sqrt[1 - x] - I Sqrt[x]}}

I tried the following

ParametricPlot[{Re[#], Im[#]} & /@ G , {x, 0, 1}, PlotRange -> {{-1, 1}, {-1, 1}}, PlotLegends -> "Expressions"]

This gives

enter image description here

while G1=Sqrt[1 - x] + I Sqrt[x], G2=Sqrt[1 - x] + I Sqrt[x] .Thus G={{G1},{G2}} and for G1, I got

ParametricPlot[{Re[G1], Im[G1]} , {x, 0, 1}, PlotRange -> {{-1, 1}, {-1, 1}}, PlotLegends -> "Expressions"]

enter image description here

and for G2, I got

ParametricPlot[{Re[G2], Im[G2]}, {x, 0, 1}, PlotRange -> {{-1, 1}, {-1, 1}}, PlotLegends -> "Expressions"]

enter image description here

Thanks in advance..

M. H.
  • 39
  • 4

2 Answers2

1

The list of functions should be a simple List

G = {Sqrt[1 - x] + I Sqrt[x], Sqrt[1 - x] - I Sqrt[x]};

Use ReIm and since ParametricPlot has the attribute HoldAll, use Evaluate

ParametricPlot[Evaluate[ReIm /@ G], {x, 0, 1},
 AxesLabel -> (Style[#, 12, Bold] & /@ {Re, Im}),
 PlotRange -> {{-1, 1}, {-1, 1}},
 PlotLegends -> Placed[G, {0.7, 0.65}]]

enter image description here

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
0

H. The problem with coloring is usually solved by evaluating the expression passed as an argument before drawing. In your case however you'll need to also extract or flatten your list of lists.

So either try this:

ParametricPlot[Evaluate[{Re[First@#], Im[First@#]} & /@ G], {x, 0, 1}, PlotRange -> {{-1, 1}, {-1, 1}}, PlotLegends -> "Expressions"]

or this:

ParametricPlot[Evaluate[{Re[#], Im[#]} & /@ Flatten@G], {x, 0, 1}, PlotRange -> {{-1, 1}, {-1, 1}}, PlotLegends -> "Expressions"]
Ranza
  • 1,205
  • 9
  • 22
  • I run these and I got the Expressions but with empty curves on complex plane.. – M. H. Jan 14 '19 at 22:56
  • You must have used a different G, with G = {{Sqrt[1 - x] + I Sqrt[x]}, {Sqrt[1 - x] - I Sqrt[x]}} I get exactly the same result as the second answer you've got. – Ranza Jan 14 '19 at 23:45