(* Do not save output when exit from Mathematica *)
SetOptions[EvaluationNotebook[],NotebookEventActions -> {"WindowClose":> FrontEndExecute[FrontEndToken["DeleteGeneratedCells"]]}];

Basic Plots

(* Plot a basic graph *)

Plot[x^2,{x,-4,4}]

(* Now Add some options *)
Plot[x^2,{x,-4,4}, 
PlotStyle-> Red, 
PlotRange->4, 
AspectRatio->Automatic, 
GridLines->{Range[-4,4], Range[-4,4]}, 
AxesLabel->{"x","y"}, 
AxesStyle->Thick]

(* Graph two or more curves at once *)
Plot[{x^2, 2 x+1, 5-2 x^2},{x, -4,4}, 
AspectRatio->Automatic, 
PlotRange->{-2,7}]

(* Control style of each curve *)
(* Graph two or more curves at once *)
Plot[{x^2, 2 x+1, 5-2 x^2},{x, -4,4}, 
AspectRatio->Automatic, 
PlotRange->{-2,7}, PlotStyle->{{Red,Dashing[Small]},Blue,{Brown,Thickness[0.005]}}]

(* Add legends to the graphs *)
Plot[{Sin[x],Sin[2 x], Sin[3 x]}, {x,0,2 Pi}, PlotLegends->"Expressions"]

(* Shaded area under the graph *)
Plot[2 Sin[x] + x, {x,0,15}, Filling-> Bottom]

(* Shaded area between 2 graphs *)
Plot[{Sin[x] + x/2, Sin[x]+x}, {x, 0, 10}, Filling ->{1->{2}}]

(* Transparent Filling *)
Plot[Evaluate[Table[BesselJ[n,x],{n,4}]],{x,0,10}, Filling ->Axis]

(* Polar Graphics Example *)
PolarPlot[Cos[5 t],{t, 0, Pi}]

(* Parametric Graph *)
ParametricPlot[{Cos[3 t], Sin[2 t]}, {t, 0, 2 Pi}]

3D Graphs

(* Basic 3D plot *)

Plot3D[x * Cos[y], {x,0,1}, {y, 0, 2 Pi}]

(* Same 3D plot using options *)
Plot3D[x * Cos[y], {x,0,1}, {y, 0, 2 Pi},
PlotStyle->Green,
Mesh->None, Boxed->False, AxesEdge->{{-1,-1},{-1,-1},{-1,-1}}]

Dynamic Graph

(* Example of dynamically updating values of Graphics function *)

Dynamic@Module[{hour,min,sec,ht,mt,st},Clock[]; {hour,min,sec} = Take[DateList[],-3];
ht=Pi/2 - 2 Pi hour/12 -2 Pi min/720; mt =Pi/2 -2 Pi min/60;
st=Pi/2 -2 Pi Floor[sec]/60;
Graphics[{Arrowheads[0.1],Arrow[{{0,0},0.6 {Cos[ht],Sin[ht]}}],
Arrow[{{0,0},0.85 {Cos[mt],Sin[mt]}}],
Line[{{0,0},0.85 {Cos[st],Sin[st]}}], PointSize[Medium],
Table[Point[0.9 {Cos[i],Sin[i]}],{i,0,2 Pi, Pi/6}],
Point[{0,0}],Circle[]}]]

Anymated Graph

(* Define a few functions *)
p1[phi_]:= RotationTransform[phi,{0,0,1}][{0,2,0}];

p2[phi_]:=RotationTransform[phi+Pi/2,{1,0,1}][{0,2,0}];

p3[phi_]:=RotationTransform[phi+Pi,{1,0,0}][{0,2,0}];

p4[phi_]:=RotationTransform[phi+3Pi/2,{1,0,-1}][{0,2,0}];

Animate[Graphics3D[{Specularity[White,30], 
Sphere[], 
Sphere[p1[phi],.4],
Sphere[p2[phi], .4],
Sphere[p3[phi],.4],
Sphere[p4[phi], .4]},
Lighting->{{"Ambient", GrayLevel[.1]},
{"Point",Red,p1[phi]},
{"Point", Green,p2[phi]},
{"Point", Blue,p3[phi]},
{"Point", Yellow,p4[phi]}},
PlotRange->2.5, 
Background->Black, 
Boxed->False, 
ImageSize->300],
{phi,0,2 Pi},
SaveDefinitions->True, 
AnimationRunning->False]