Use DO loop in Plot order at mathematica 8

  • Context: Mathematica 
  • Thread starter Thread starter es.no
  • Start date Start date
  • Tags Tags
    Loop Mathematica Plot
Click For Summary
SUMMARY

The discussion focuses on using a DO loop in Mathematica 8 to plot multiple functions in a single graph. Users can utilize the Plot function with a list of functions, such as Plot[{f1, f2, f3}, {x, xmin, xmax}]. Alternatively, the Table function can generate a list of functions for plotting, as demonstrated with Plot[Table[Sqrt[r^2 - x^2], {r, 1, 4}], {x, 0, 4}]. The DO loop method is also presented, where a list is populated with plots using AppendTo within the loop, ultimately displayed with Show.

PREREQUISITES
  • Understanding of Mathematica 8 syntax and functions
  • Familiarity with the Plot function in Mathematica
  • Knowledge of list manipulation in Mathematica
  • Basic grasp of mathematical functions and graphing
NEXT STEPS
  • Explore advanced plotting techniques in Mathematica, such as Plot3D
  • Learn about the Table function in Mathematica for generating lists
  • Investigate the use of dynamic variables in plotting
  • Study the differences between AppendTo and other list-building methods in Mathematica
USEFUL FOR

Mathematica users, educators, and students interested in visualizing mathematical functions and enhancing their graphing skills using loops and lists.

es.no
Messages
12
Reaction score
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: 703
Physics news on Phys.org
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   Reactions: es.no

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K