Message Boards Message Boards

0
|
1373 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Generalize a plot for different parameter values

Posted 1 year ago

Dear friends please help me ...i have plot this and got an accurate graph now i want to plot for various 'a' but i dont know how i should plot it.

a=1;
prmtrcplt1 = ParametricPlot[{x, a Sin[2 x]}, {x, -Pi, Pi},
   PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300];

prmtrcplt2 = ParametricPlot[{a Sin[2 x], x}, {x, -Pi, Pi},
  PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300];

Row[{prmtrcplt1, prmtrcplt2}, Spacer[5]]
POSTED BY: fozia shaikh
2 Replies

Try:

prmtrcplt1 = 
  ParametricPlot[
   Evaluate@Table[{x, a Sin[2 x]}, {a, 0, 1, 1/4}], {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300];

prmtrcplt2 = 
  ParametricPlot[
   Evaluate@Table[{a Sin[2 x], x}, {a, 0, 1, 1/4}], {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300];

Row[{prmtrcplt1, prmtrcplt2}, Spacer[5]]

Or:

prmtrcplt3[a_] := 
  ParametricPlot[{x, a Sin[2 x]}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300];

prmtrcplt4[a_] := 
  ParametricPlot[{a Sin[2 x], x}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300];

Row[{Table[prmtrcplt3[a], {a, 0, 1, 1/3}], 
  Table[prmtrcplt4[a], {a, 0, 1, 1/3}]}, Spacer[5]]
POSTED BY: Mariusz Iwaniuk

Something interactive like this?

Manipulate[Row[{ParametricPlot[{x, a Sin[2 x]}, {x, -Pi, Pi},
    PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300],
   Spacer[25],
   ParametricPlot[{a Sin[2 x], x}, {x, -Pi, Pi},
    PlotRange -> {{-Pi, Pi}, {-3, 3}}, ImageSize -> 300]}],
 {a, 1/2, 2}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract