Plotting multiple sections of graphs.

Is there a way I can plot 5 different functions together?I only require specific sections of the graphs, like between [0,3] for the first, (3,6] for the next, etc?

Thanks!

Piecewise

You could make a piecewise expression like:

piecewise(x>=0 and x<=3, f, x>3 and x<=5, g, h);

                         { f        0 <= x and x <= 3
                         {
                         { g        3 < x and x <= 5
                         {
                         { h            otherwise

Take a look at the help for piecewise for more detail.

A more general way

A more general way of doing this is to plot the separate functions and then combine them into a single graph using <code>display</code>. Here is a simple example:

with(plots);

p1:=plot(sin(x),x=0..Pi);

p2:=plot(cos(x),x=Pi..2*Pi);

display(p1,p2);

David Clayworth Maplesoft GUI Developer

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}