Plotting 2(or more) functions at once

  • Thread starter karkas
  • Start date
  • #1
132
1
Hey all, I want to ask a simple question that I can't seem to get answered myself. How is it possible to get Mathematica to plot 2 functions at once? As in, I want to have x^2 {x,0,1} and x^3 {x,1,2} in the same plot graph.

More specifically, what I'm trying to do is plot the y-t graph of a ball bouncing on the ground, and I'm thinking of doing so by combining the equations of motion for every discrete stage of the bouncing.

Any help is greatly appreciated.
 

Answers and Replies

  • #2
1,069
29
g1 = Plot[x^2, {x, 0, 1}];
g2 = Plot[x^3, {x, 1, 2}];
Show[g1, g2]

If it isn't clear whether it is working then substitute x^3-1 for a moment
 
  • #3
132
1
g1 = Plot[x^2, {x, 0, 1}];
g2 = Plot[x^3, {x, 1, 2}];
Show[g1, g2]

If it isn't clear whether it is working then substitute x^3-1 for a moment
Thanks a huge ton. It was clear as hell, didn't think of that.
 

Related Threads on Plotting 2(or more) functions at once

Replies
1
Views
2K
Replies
3
Views
4K
Replies
6
Views
4K
Replies
3
Views
13K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
33K
Top