1.9.7 Converting between Types of GraphicsContour, density and surface plots are three different ways to display essentially the same information about a function. In all cases, you need the values of a function at a grid of points. The Mathematica functions ContourPlot, DensityPlot and Plot3D all produce Mathematica graphics objects that include a list of the values of your function on a grid. As a result, having used any one of these functions, Mathematica can easily take its output and use it to produce another type of graphics. | Here is a surface plot. | |
In[1]:=
Plot3D[BesselJ[nu, 3x], {nu, 0, 3}, {x, 0, 3}]
|
Out[1]=
|
|
| This converts the object produced by Plot3D into a contour plot. | |
In[2]:=
Show[ ContourGraphics[ % ] ]
|
Out[2]=
|
|
| Show[ContourGraphics[g]] | convert to a contour plot | | Show[DensityGraphics[g]] | convert to a density plot | | Show[SurfaceGraphics[g]] | convert to a surface plot | | Show[Graphics[g]] | convert to a two-dimensional image |
Conversions between types of graphics. | You can use GraphicsArray to show different types of graphics together. | |
In[3]:=
Show[ GraphicsArray[ {%, %%} ] ]
|
Out[3]=
|
|
|