Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2334 > unrolled thread

color-coding two sets of plotted curves?

Started byDushan Mitrovich <dushanm@spinn.net>
First post2011-05-13 10:27 +0000
Last post2011-05-14 07:11 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  color-coding two sets of plotted curves? Dushan Mitrovich <dushanm@spinn.net> - 2011-05-13 10:27 +0000
    Re: color-coding two sets of plotted curves? Peter Pein <petsie@dordos.net> - 2011-05-14 07:11 +0000

#2334 — color-coding two sets of plotted curves?

FromDushan Mitrovich <dushanm@spinn.net>
Date2011-05-13 10:27 +0000
Subjectcolor-coding two sets of plotted curves?
Message-ID<iqj13a$rev$1@smc.vnet.net>
After a lot of experimentation I finally found a way to plot two sets of 
curves orthogonal using one color per set.  The following relates 
Bipolar and Cartesian coordinates, then plots the sets of coordinate 
lines Red and Blue:

xy[Xi_, Theta_] := {  Sinh[Xi]/(Cosh[Xi]+Cos[Theta]),
                     Sin[Theta]/(Cosh[Xi]+Cos[Theta])}

pXi = ParametricPlot[Evaluate@Table[xy[(j+1)/4, Pi u], {j,0,11}],
                      {u,-1,1}, PlotRange->{{0,4.2},{-2,2}},
                      PlotPoints->50, PlotStyle->{Red}];

pTheta = ParametricPlot[Evaluate@Table[xy[6 (u+1), j Pi/6], {j,0,11}],
                      {u,-1,1}, PlotRange->{{0,4.2},{-2,2}},
                      PlotPoints->50, PlotStyle->{Blue}];

Show[pXi,pTheta]

Everything else I tried plotted all the curves the same color.  Am I 
using the recommended approach or is there another, more direct one?

- Dushan

[toc] | [next] | [standalone]


#2357

FromPeter Pein <petsie@dordos.net>
Date2011-05-14 07:11 +0000
Message-ID<iql9va$9tt$1@smc.vnet.net>
In reply to#2334
Am 13.05.2011 12:27, schrieb Dushan Mitrovich:
> After a lot of experimentation I finally found a way to plot two sets of 
> curves orthogonal using one color per set.  The following relates 
> Bipolar and Cartesian coordinates, then plots the sets of coordinate 
> lines Red and Blue:
> 
> xy[Xi_, Theta_] := {  Sinh[Xi]/(Cosh[Xi]+Cos[Theta]),
>                      Sin[Theta]/(Cosh[Xi]+Cos[Theta])}
> 
> pXi = ParametricPlot[Evaluate@Table[xy[(j+1)/4, Pi u], {j,0,11}],
>                       {u,-1,1}, PlotRange->{{0,4.2},{-2,2}},
>                       PlotPoints->50, PlotStyle->{Red}];
> 
> pTheta = ParametricPlot[Evaluate@Table[xy[6 (u+1), j Pi/6], {j,0,11}],
>                       {u,-1,1}, PlotRange->{{0,4.2},{-2,2}},
>                       PlotPoints->50, PlotStyle->{Blue}];
> 
> Show[pXi,pTheta]
> 
> Everything else I tried plotted all the curves the same color.  Am I 
> using the recommended approach or is there another, more direct one?
> 
> - Dushan
> 

Hi,

I'd use ParametricPlot:

ParametricPlot[xy[x,y]//Evaluate,{x,-0,3},{y,-Pi,Pi},PlotStyle->Opacity[0],MeshStyle->{Red,Blue},Axes->None,Frame->True,PlotRange->{{0,4.2},{-2,2}},PlotPoints->50]//Quiet

Peter

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web