Generating and Plotting Lists

1. Making a List of Ordered Pairs

We will often be in a situation where we have to generate a series of points and then manipulate that list of ordered pairs (i.e. plot it, perform vector manipulations, etc). Consider the example below for making a list of points corresponding to a sine curve.

(* define a list of ordered pairs and call it table1. the interator in the command below tells Mathematica to vary x from a lower limit of 2 up to 30 in steps of 1. The sine function in Mathematica requires radians in the argument. *)
deg2rad = (π/180.0);
table1 = Table[{x,Sin[x*deg2rad]},{x,2,30,1}]

2. Plotting a List

Once you have made your list of ordered pairs, it's easy to plot it and like many things in Mathematica, painful if you want to do things a little differently. The cells below demonstrate some of the options for making plots of lists.

p1 = ListPlot[table1]

p2=ListPlot[table1,Joined->True]

(* make big dots. *)
p3 = ListPlot[table1, PlotStyle->{PointSize[0.02],RGBColor[1,0,0]}]

(* combine plots. *)
Show[{p3,p2}]