How to | Plot Data
The Wolfram Language offers extensive support for plotting all kinds of data in many different ways.
Consider the following data to be plotted (stored as sdata):
sdata = Table[1. Sin[2 i], {i, 0, 2 Pi, Pi / 12}]Use ListPlot to plot sdata:
ListPlot[sdata]Plot sdata by filling to the axis:
ListPlot[sdata, Filling -> Axis]Specify a color and increase the size of the data points:
ListPlot[sdata, PlotStyle -> {PointSize[Medium], Red}]Use ListLinePlot to plot sdata with a connecting line:
ListLinePlot[sdata]Create another set of data to plot (stored as cdata):
cdata = Table[1. Cos[i / 2], {i, 0, 2 Pi, Pi / 12}];Plot sdata and cdata together:
ListLinePlot[{sdata, cdata}]Use ListPolarPlot to plot cdata as points at polar coordinates:
ListPolarPlot[cdata]Define another dataset to plot (stored as data):
data = Table[Sin[j ^ 2 + i ^ 2], {i, 0, Pi, Pi / 30}, {j, 0, Pi, Pi / 30}];Length[data]Plot only specific parts of data:
ListPlot[{data[[1]], data[[19]]}]Connect these points with lines:
ListLinePlot[{data[[1]], data[[19]]}]Generate a 3D scatter plot of points with an array of height values for data using ListPointPlot3D:
ListPointPlot3D[data]Use ListPlot3D to plot data as a surface:
ListPlot3D[data]Use ListDensityPlot to generate a density plot from the height values of data:
ListDensityPlot[data]Use ListContourPlot to generate a contour plot instead:
ListContourPlot[data]This constructs a Demonstration of data plotting:
Manipulate[ListPolarPlot[Table[Cos[i / n] ^ m, {i, -k Pi, t Pi, Pi / d}], PlotStyle -> {PointSize[s], Red}, ImageSize -> {400, 400}, Axes -> None, PlotRange -> {{-1.1, 1.1}, {-1.1, 1.1}}], {{n, 0.32}, 0.1, 5, 0.01}, {m, 1, 4, 1}, {{t, 4.14}, 2, 6}, {{d, 100}, 10, 200, 10}, {{k, 4}, -1.5, 8}, {{s, 0.006}, 0.003, 0.01, 0.001}]