Plot[f,{x,x1,x2}] plots specified f from x=x1 to x=x2.
Plot[F[x], {x,x1,x2}] plots user-defined function F[x] from x=x1 to x=x2.
Plot[{f,g,...},{x,x1,x2}] plots f, g,... from x=x1 to x=x2.
Plot3D[f, {x, xmin, xmax}, {y, ymin, ymax}] gives a 3-d plot of f(x,y).
ContourPlot[f, {x, xmin, xmax}, {y, ymin, ymax}, ContourShading -> False] gives contour plot of f(x,y).
DensityPlot is similar to ContourPlot but uses shading without contour lines.
ImplicitPlot for curve of f(x,y)=0 in xy-plane:
<< Graphics`ImplicitPlot`
ImplicitPlot[f == 0, {x,x1,x2}, {y,y1,y2}]
Parametric plot of y(x) from defined x[t] and y[t]: ParametricPlot[{x[t], y[t]}, {t, 0, tmax}, AspectRatio
-> Automatic]
To SHOW PLOT in different domains:
myplot=Plot[Sin[x],{x,0,10}]
Show[myplot,PlotRange->{{x1,x2},{y1,y2}}] (For all pts: PlotRange->All)
To SHOW several plots superimposed:
Show[{myplot1,myplot2,myplot3},PlotRange->{{x1,x2},{y1,y2}}]
Multicolor plot of a family of functions: Plot[Evaluate[Table[Cos[n Pi x], {n,1,5}]], {x, -1, 1}, PlotStyle
-> {Red, Yellow, Green, Blue, Orange}]
Useful Aliases (in what follows, f,f1,f2 slots are specified as functions of x:
myplot[f_,x_,x1_,x2_]:= Plot[f,{x,x1,x2},PlotRange->All, AxesLabel->{x,f}]
myplot2a[f1_,f2_,x1_,x2_]:=Plot[{f1, f2}, {x, x1, x2},PlotRange->All,PlotStyle->{Blue, Red}]
myplot2b[f1_,f2_,x1_,x2_]:=Plot[{f1, f2}, {x, x1, x2},PlotRange->All,PlotStyle ->
{Thickness[.003],Dashing[{.02,.015}]}]
myplot3[f1_,f2_,f3_,x1_,x2_]:=Plot[{f1,f2,f3}, {x,x1,x2},PlotRange->All,PlotStyle->{Blue,Red,
Green}]
LISTPLOTS
ListPlot[xflist,PlotJoined->True,PlotRange->All], where, xflist is a paired list of {x,f} entries (see
"LISTS" below).
Useful Alias: mylistplot[data_]:=ListPlot[data,PlotJoined->True,PlotRange->All,AxesLabel->{"x","f"}]
where, e.g., data=Table[{xval[i],fval[i]},{i,1,100,1}];
Multiple ListPlots shown together:
<< Graphics`MultipleListPlot`;
MultipleListPlot[list1, list2, PlotJoined->{True, False},PlotRange->All]
PLOT OPTIONS
Plot[f,{x,x1,x2}, option1, option2, ...], where some options follow:
To restrict plotted values between f = c1 and f = c2: PlotRange -> {c1,c2}
To plot all of values of f in the interval (if Mathematica fails to): PlotRange -> All
To increase the number of sampled plot points used to 50: PlotPoints -> 50
For labels on x-axis and y-axis: AxesLabel -> {"x", "f"}
For dashed line: PlotStyle -> Dashing[{0.02,0.015}]
For 2 curves (full and dashed): PlotStyle -> {Thickness[.003],Dashing[{.02,.015}]}
For colored line: PlotStyle -> Blue or Red, Green, Yellow, Orange, Purple, or Black (default).
For 2 curves of different color: PlotStyle -> {Blue,Red}
For 2 curves of different color, thickness, dashing (can omit any options): PlotStyle ->
{{Thickness[0.008], Blue}, {Thickness[0.01], Dashing[{0.012, 0.015}], Red}}
For plot label: PlotLabel -> FontForm["My Graph", {"Helvetica-Bold", 12}]
For grid-lines on plot: GridLines -> Automatic
For border around plot: Frame -> True
For no ticks on frame: FrameTicks -> None
To set font for all future graphics text: $TextStyle = {FontFamily -> "Times", FontSize -> 12}
To change Plot3D viewpoint to coordinates x1,x2,x3: ViewPoint-> {x1,x2,x3}
To eliminate shading in the ContourPlot: ContourShading -> False
FIELD PLOTS
To create a vector-field plot of grad f(x,y) from x0 to x1 and y0 to y1, load the graphics plot package by
typing: Needs["Graphics`PlotField`"]