MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

how to generate many plots without so many input lines?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9651] how to generate many plots without so many input lines?
  • From: robpeterson at iname.com
  • Date: Mon, 17 Nov 1997 19:50:11 -0500
  • Organization: Flashnet Communications, http://www.flash.net
  • Sender: owner-wri-mathgroup at wolfram.com

The following code nicely plots a bunch of curves on one plot.  

***************************************
x[u_,v_]:=(u+1+Exp[u]
Cos[v])/Pi;
y[u_,v_]:=(v+ Exp[u] Sin[v])/Pi;

(* here are the equipotential surfaces  *) v=Pi;
a=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=Pi/1.2;
b=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=Pi/1.5;
c=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=Pi/2;
d=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=Pi/4;
e=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=-Pi/4;
f=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=-Pi/2;
g=ParametricPlot[{x[u,v],y[u,v]},{u,-2Pi,Pi},
    AspectRatio->Automatic,DisplayFunction->Identity];

v=-Pi;
h=ParametricPlot[{x[u,v],y[u,v]},{u,-Pi,Pi},AspectRatio->Automatic,
    DisplayFunction->Identity];

Show[{a,b,c,d,e,f,g,h},
  DisplayFunction->$DisplayFunction]

*****************************************

Surely there is a way to generate the list {a,b,c,d,e,f,g,h} more
easily/elegantly. Here's what I tried:

{a,b,c,d,e,f}=
  ParametricPlot[{x[u,v],y[u,v]},{u,-Pi,Pi},AspectRatio->Automatic,
      DisplayFunction->Identity]
/.  v->{Pi/1.2,Pi/1.5,Pi/2,Pi/4,Pi/8,Pi/16}

This doesn't work at all.  I get all kinds of error messages I don't
understand. Can someone tell me whether each plot must be generated on
a separate line?

Thanks for any clues, Rob



  • Prev by Date: Re: More Integrate woes
  • Next by Date: Mathematica 3.01 is slower than Mathematica 3.0 on PowerMacs!
  • Previous by thread: Re: Re: Which, If and "neither True nor False"
  • Next by thread: Re: how to generate many plots without so many input lines?