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

Maple MAPLE: Superimpose graphs of 10 discontinuous functions

  1. Feb 1, 2012 #1

    I'm working on an assignment which requires me to superimpose the graphs of 10 different discontinuous functions on the same graph. Can someone please explain step-by-step how to do so in MAPLE? By the way, I have absolutely no experience in any computer programming in any form and I've never used Maple before...sigh.

    The horizontal axis is time (t) and the vertical axis is foward rate (f(t)).
    Function 1: (Jan 20 data)
    For 0<t<1, f(t)=t+2
    For t=1, f(t)=4
    For 1<t<2, f(t)=2t+3
    For t=2, f(t)=9
    For 2<t<3, f(t)=2t+7

    Function 2: (Jan 21 data)
    For 0<t<1, g(t)=t+3
    For t=1, g(t)=5
    For 1<t<2, g(t)=2t+4
    For t=2, g(t)=10
    For 2<t<3, g(t)=3t+6

    etc...I have similar functions, 10 in total, and I need to superimpose all of them on the same graph.

    Furthermore, how can I add a legend clearing labelling each graph as "Jan 20" for graph of function 1, "Jan 21 "for graph of function 2,..., and "Jan29" for graph of function 10?

    Any help would be very much appreciated! :)
  2. jcsd
  3. Feb 3, 2012 #2
    So I did some search on the internet and tried to modify some MAPLE code and I got something like the following.


    And now I have some troubles...

    1) In the legend part, I don't know why but there is a label "Points 1". How can I remove it from the legend?

    2) How can I change the "color" of the curves for each day? (e.g. I want blue for Jan 17, purple for Jan 18, etc., and I need 10 clearly distinguishable colors in total.)

    Please help! Anyone?
  4. Feb 5, 2012 #3
    So I typed in 7 of the piecewise functions, but Maple refuses to overlap/superimpose more than 6 functions on the same graph, how can I fix this problem???? Is it possible to overlap more than 6 functions on the same graph in MAPLE? Does anyone know?

    Help, please!!!
    Last edited: Feb 5, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook