PDA

View Full Version : Plotting 2(or more) functions at once


karkas
Oct24-11, 07:45 AM
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.

Bill Simpson
Oct24-11, 10:19 AM
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

karkas
Oct24-11, 04:57 PM
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.