Mathematica HowTo
How to | Plot Data
Mathematica offers extensive support for plotting all kinds of data in many different ways.
Consider the following data to be plotted (stored as sdata):
In[1]:=
Click for copyable input
Out[1]=
Use ListPlot to plot sdata:
In[68]:=
Click for copyable input
Out[68]=
Plot sdata by filling to the axis:
In[69]:=
Click for copyable input
Out[69]=
Specify a color and increase the size of the data points:
In[70]:=
Click for copyable input
Out[70]=
Use ListLinePlot to plot sdata with a connecting line:
In[71]:=
Click for copyable input
Out[71]=
Create another set of data to plot (stored as cdata):
In[2]:=
Click for copyable input
Plot sdata and cdata together:
In[3]:=
Click for copyable input
Out[3]=
Use ListPolarPlot to plot cdata as points at polar coordinates:
In[74]:=
Click for copyable input
Out[74]=
Define another dataset to plot (stored as data):
In[5]:=
Click for copyable input
The dataset has 31 sublists:
In[6]:=
Click for copyable input
Out[6]=
Plot only specific parts of data:
In[76]:=
Click for copyable input
Out[76]=
Connect these points with lines:
In[77]:=
Click for copyable input
Out[77]=
Generate a 3D scatter plot of points with an array of height values for data using ListPointPlot3D:
In[81]:=
Click for copyable input
Out[81]=
Use ListPlot3D to plot data as a surface:
In[82]:=
Click for copyable input
Out[82]=
Use ListDensityPlot to generate a density plot from the height values of data:
In[83]:=
Click for copyable input
Out[83]=
Use ListContourPlot to generate a contour plot instead:
In[84]:=
Click for copyable input
Out[84]=
    
This constructs a Demonstration of data plotting:
In[85]:=
Click for copyable input
Out[85]=
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team