##### From The Student's Introduction to MATHEMATICA: A Handbook for Precalculus, Calculus, and Linear Algebra

## 3.8 Combining Graphics

So you want to combine two or more graphics together as one? There are many possibilities here, so we ll address each in turn.

### Superimposing Plots

It is often desirable to view two or more plots together. If you simply want to plot several functions on the same set of axes, enter a *list* containing these functions as the first argument to the **Plot** command and you ll have it:

In[1]:= <b class="bold">Clear[f, g];</b><b class="bold"> f[x+] := 1 <span class="unicode">?</span> x;</b><b class="bold"> g[x_] := x</b><sup<b class="bold">2</b></sup><b class="bold">;</b> In[4]:= <b class="bold">Plot[{f[x], g[x], f[x] * g[x]}, {x, <span class="unicode">?</span>1, 1}]</b><span class="inlinemediaobject"><a NAME="IMG_191"> href="portalcontent.asp?bkid=31099&image_src=http://images.books24x7.com/bookimages/id_31099/fig115%5F01%5F0%2Ejpg&image_id=191&previd=IMG_191"> target="_parent"><img alt="Image from book"> border="0"> height="158"> id="IMG_191"> src="http://images.books24x7.com/bookimages/id_31099/fig115_01.jpg"> title="Click To expand"> width="290"></a></span>

On your monitor the three functions are given three distinct colors. To better distinguish between them, one may wrap the list of functions with the **Tooltip** command. When you mouseover any curve in the resulting plot, a tooltip will pop up displaying that function s expression. Note that the output in printed form is indistinguishable from the prior output, so this feature is only useful in a live session.

In[5]:= <b class="bold">Plot[Tooltip[{f[x], g[x], f[x] * g[x]}], {x, <span class="unicode">?</span>1, 1}]</b><span class="inlinemediaobject"><a NAME="IMG_192"> href="portalcontent.asp?bkid=31099&image_src=http://images.books24x7.com/bookimages/id_31099/fig115%5F02%5F0%2Ejpg&image_id=192&previd=IMG_192"> target="_parent"><img alt="Image from book"> border="0"> height="158"> id="IMG_192"> src="http://images.books24x7.com/bookimages/id_31099/fig115_02.jpg"> title="Click To expand"> width="290"></a></span>

One may also use the **PlotStyle** option to change the appearance of...

##### Products & Services

##### Topics of Interest

3.9 Enhancing Your Graphics The time will soon come when you feel the irresistible desire to add some sort of graphic enhancement to a plot. Maybe it will be something as minor as an arrow and some...

5.1 Computing Limits An understanding of limits is fundamental to an understanding of calculus. Let s start by defining a few functions: <span class="inlinemediaobject"><a...

3.2 Plotting a Function We begin with a simple example: In[1]:= <b class="bold">Clear[f];</b><b class="bold"> f[x_] := x</b><sup<b...

4.1 Factoring and Expanding Polynomials A polynomial in the variable x is a function of the form: where the coefficients a 0, a 1, , a n are real numbers. Polynomials may be expressed in expanded or...

6.1 Vectors A standard notation for a vector in the plane is a coordinate pair, such as 2, 5 . This represents the vector that has its tail at the origin and its head at the point with x coordinate 2...