Use DO loop in Plot order at mathematica 8

In summary, the conversation was about using a Do loop in Mathematica 8 to plot multiple graphs on one plot. One suggestion was to use the Plot function with a list of functions, while another was to use Table to generate the list of functions. The conversation also mentioned the option of manually creating the list with a Do loop.
  • #1
es.no
12
0
Can anyone help me to in this problem?
I want to use DO loop in Plot order at mathematica 8, how can I do this?
I want to change one variables and see the changes in other variables in the graph, and want to plot all of my graph in one Plot order. Like this.

I Uploaded my file too.
 

Attachments

  • mmmmm.png
    mmmmm.png
    1.7 KB · Views: 635
Physics news on Phys.org
  • #2
This does not use a Do loop.

Look up Plot in the help system and see that

Plot[{f1,f2,f3} will plot f1 and f2 and f3 on the same graph.

Then realize you can make {f1,f2,f3} using Table[].

Plot[Table[Sqrt[r^2 - x^2], {r, 1, 4}], {x, 0, 4}, AspectRatio -> Automatic]

Or do this the hard and error prone way with a Do loop

r = 4;
plotlist = {};
Do[
AppendTo[plotlist, Plot[Sqrt[r^2 - x^2], {x, 0, 4}]];
r = r - 1
, {4}];
Show[plotlist, AspectRatio -> Automatic]
 
  • Like
Likes es.no

FAQ: Use DO loop in Plot order at mathematica 8

How do I use a DO loop in Plot order in Mathematica 8?

To use a DO loop in Plot order in Mathematica 8, you can use the command "Do[expression, {i, imin, imax}]" where "expression" is the function you want to plot, "i" is the variable used in the loop, and "imin" and "imax" are the minimum and maximum values for "i". This will plot the function for each value of "i" within the specified range.

Can I use multiple functions in a DO loop when plotting in Mathematica 8?

Yes, you can use multiple functions in a DO loop when plotting in Mathematica 8. Simply separate the functions with a comma within the "expression" portion of the command, and they will all be plotted for each value of "i" in the loop.

How can I customize the plot order in a DO loop in Mathematica 8?

To customize the plot order in a DO loop in Mathematica 8, you can use the command "Do[expression, {i, imin, imax, di}]" where "di" is the increment value for "i". This will allow you to specify the order in which the functions are plotted based on the value of "i".

Is it possible to use a DO loop when plotting a function with multiple variables in Mathematica 8?

Yes, it is possible to use a DO loop when plotting a function with multiple variables in Mathematica 8. Simply include all variables in the "expression" portion of the command, and specify the ranges for each variable in the loop.

Can I use conditional statements within a DO loop when plotting in Mathematica 8?

Yes, you can use conditional statements within a DO loop when plotting in Mathematica 8. Simply use the "If" or "If[condition, expression1, expression2]" command within the "expression" portion of the DO loop, and the function will be plotted based on the specified condition.

Similar threads

Replies
3
Views
2K
Replies
5
Views
2K
Replies
2
Views
2K
Replies
9
Views
721
Replies
1
Views
1K
Replies
2
Views
693
Back
Top