This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Wolfram Research, Inc.

Converting between Types of GraphicsParametric Plots

1.9.9 Plotting Lists of Data

So far, we have discussed how you can use Mathematica to make plots of functions. You give Mathematica a function, and it builds up a curve or surface by evaluating the function at many different points.

This section describes how you can make plots from lists of data, instead of functions. (Section 1.11.3 discusses how to read data from external files and programs.) The Mathematica commands for plotting lists of data are direct analogs of the ones discussed above for plotting functions.

Functions for plotting lists of data.

Here is a list of values.

In[1]:= t = Table[i^2, {i, 10}]


This plots the values.

In[2]:= ListPlot[t]


This joins the points with lines.

In[3]:= ListPlot[t, PlotJoined -> True]


This gives a list of , pairs.

In[4]:= Table[{i^2, 4 i^2 + i^3}, {i, 10}]


This plots the points.

In[5]:= ListPlot[%]


This gives a rectangular array of values. The array is quite large, so we end the input with a semicolon to stop the result from being printed out.

In[6]:= t3 = Table[Mod[x, y], {y, 20}, {x, 30}] ;

This makes a three-dimensional plot of the array of values.

In[7]:= ListPlot3D[t3]


You can redraw the plot using Show, as usual.

In[8]:= Show[%, ViewPoint -> {1.5, -0.5, 0}]


This gives a density plot of the array of values.

In[9]:= ListDensityPlot[t3]


Converting between Types of GraphicsParametric Plots