Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Plotting 2(or more) functions at once

  1. Oct 24, 2011 #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.
     
  2. jcsd
  3. Oct 24, 2011 #2
    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
     
  4. Oct 24, 2011 #3
    Thanks a huge ton. It was clear as hell, didn't think of that.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook