(*^ ::[ frontEndVersion = "NeXT Mathematica Notebook Front End Version 2.1"; next21StandardFontEncoding; paletteColors = 128; automaticGrouping; currentKernel; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e8, 24, "Times"; ; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e6, 18, "Times"; ; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, L1, e6, 14, "Times"; ; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L1, a20, 18, "Times"; ; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L1, a15, 14, "Times"; ; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L1, a12, 12, "Times"; ; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 10, "Times"; ; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L1, 12, "Courier"; ; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; ; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L1, 12, "Courier"; ; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, L1, 10, "Times"; ; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1, 12, "Times"; ; fontset = Left Header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1, 12, "Times"; ; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, L1, 12, "Times"; ; fontset = Left Footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, L1, 12, "Times"; ; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12, "Courier"; ; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; ] :[font = title; inactive; preserveAspect; startGroup; ] Graphics Programming :[font = subtitle; inactive; preserveAspect; ] Tom Wickham-Jones :[font = subsubtitle; inactive; preserveAspect; ] Wolfram Research :[font = section; inactive; preserveAspect; startGroup; ] Function Plotting :[font = input; preserveAspect; ] wierdf[x_] := If[ x > -1 && x < 1, x^2, Exp[ 1- x^2]] :[font = input; preserveAspect; ] Plot[ wierdf[t], {t,-3,3}] :[font = input; preserveAspect; ] NDSolve[ {x''[t] == -x[t], x[0] == 2, x'[0] == 0}, x, {t,0,20}] :[font = input; preserveAspect; ] Plot[ Evaluate[ x[t] /. %], {t,0,20}] :[font = input; preserveAspect; ] NDSolve[ {x''[t] == -x[t] -x[t] y[t]^2, y''[t] == -y[t] -x[t] y[t]^2, x[0] == 2, x'[0] == 0, y[0] == 1, y'[0] == 0 }, {x, y}, {t,0,15}] :[font = input; preserveAspect; endGroup; ] ParametricPlot[ Evaluate[ {x[t], y[t]} /. First[%]], {t,0,15}] :[font = section; inactive; Cclosed; preserveAspect; startGroup; ] Animation :[font = text; inactive; preserveAspect; ] Only on some Front Ends :[font = input; preserveAspect; ] Do[ Plot[ Sin[ n x], {x,0,2Pi}], {n,5}] :[font = input; preserveAspect; ] Table[ Plot[ Sin[ n x], {x,0,2Pi}], {n,5}] :[font = input; preserveAspect; ] Table[ Show[ Graphics[{ RGBColor[ 1,0,0], Polygon[n {{-1,-1}, {1,-1}, {1,1},{-1,1}}]}]], {n,5}] :[font = input; preserveAspect; ] Table[ Show[ Graphics[{ RGBColor[ 1,0,0], Polygon[n {{-1,-1}, {1,-1}, {1,1},{-1,1}}]}, PlotRange -> {{-5,5}, {-5,5}}]], {n,5}] :[font = subsubsection; inactive; preserveAspect; endGroup; ] SphericalRegion :[font = section; inactive; Cclosed; preserveAspect; startGroup; ] Color :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] Color Directives :[font = input; preserveAspect; ] Show[ Graphics[{Hue[.5], Polygon[{{0,0}, {1,0}, {0,1}}]}]] :[font = input; preserveAspect; ] Show[ Graphics[ {CMYKColor[ 1,0,0,0], Polygon[{{0,0}, {1,0}, {0,1}}]}]] :[font = input; preserveAspect; endGroup; ] Show[ Graphics3D[ {SurfaceColor[ RGBColor[1,0,0]], Polygon[{{0,0,0}, {0,1,0},{1,0,0}}]}, ViewPoint -> {0,0,2}, LightSources -> {{{0,0,1}, RGBColor[1,1,1]}}]] :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] Color Coordinate :[font = input; preserveAspect; ] Plot3D[ {Tan[x y], Hue[ ArcTan[x,y] /2/Pi]}, {x,-2Pi/3, 2Pi/3},{y,-2Pi/3, 2Pi/3}] :[font = input; preserveAspect; endGroup; ] ParametricPlot3D[ {Cos[p] Sin[t], Sin[p] Sin[t], Cos[t], FaceForm[ Hue[(t+p)/Pi]]}, {p,0,2Pi}, {t,0,Pi}, Lighting -> False] :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] ColorFunction :[font = input; preserveAspect; ] Plot3D[ x y, {x,-2,2}, {y,-2,2}, ColorFunction -> Hue] :[font = input; preserveAspect; ] col[z_] := Hue[ x^0.65] :[font = input; preserveAspect; endGroup; ] ContourPlot[ Evaluate[ Sum[ Sin[ n x m y], {n,5}, {m,5}]], {x,0,2Pi}, {y,0,2Pi}, ColorFunction -> Hue] :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] ColorOutput :[font = input; preserveAspect; ] plot = Show[ Graphics[ {RGBColor[ 1,0,0], Rectangle[{0,0}, {1,1}]}, ColorOutput -> CMYKColor]] :[font = input; preserveAspect; ] colfun[ RGBColor[ r_, g_, b_]] := RGBColor[ 1-r, 1-g, 1-b] :[font = input; preserveAspect; ] colfun[ GrayLevel[ g_]] := GrayLevel[g] :[font = input; preserveAspect; endGroup; endGroup; ] Show[ plot, ColorOutput -> colfun] :[font = section; inactive; Cclosed; preserveAspect; startGroup; ] Converting and Combining Images :[font = input; preserveAspect; ] Plot[ Evaluate[ Table[ x^n, {n,5}]], {x,0,1.2}] :[font = input; preserveAspect; ] ParametricPlot3D[ Evaluate[ Table[{ Cos[x], Sin[x], n x}, {n,5}]], {x,0,2Pi}, BoxRatios -> {1,1,1}] :[font = input; preserveAspect; ] plot = Plot3D[ x^2 - y^2, {x,-1,1}, {y,-1,1}, BoxRatios -> {1,1,2}] :[font = input; preserveAspect; ] Show[ Graphics3D[ plot]] :[font = input; preserveAspect; ] plot1 = Plot3D[ y^2 - x^2, {x,-1,1}, {y,-1,1}, BoxRatios -> {1,1,2}] :[font = input; preserveAspect; ] Show[ plot1, plot] :[font = input; preserveAspect; ] Show[ ContourGraphics[ plot]] :[font = input; preserveAspect; endGroup; ] Show[ Graphics[ plot1]] :[font = section; inactive; Cclosed; preserveAspect; startGroup; ] Mathematica Graphics Coordinate Systems I ;[s] 2:0,0;11,1;42,-1; 2:1,17,13,Times,3,18,0,0,0;1,16,12,Times,1,18,0,0,0; :[font = subsection; inactive; preserveAspect; startGroup; ] PlotRange :[font = input; preserveAspect; ] plot = Plot[ Tan[x], {x,0,2Pi}] :[font = input; preserveAspect; ] FullOptions[ %, PlotRange] :[font = input; preserveAspect; ] Show[ plot, PlotRange -> All] :[font = input; preserveAspect; endGroup; ] FullOptions[%, PlotRange] :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] AspectRatio :[font = input; preserveAspect; ] Show[ Graphics[ Rectangle[ {0,0}, {4,1}]]] :[font = input; preserveAspect; ] Show[ %, AspectRatio -> 1] :[font = input; preserveAspect; ] Show[%, AspectRatio -> Automatic] :[font = text; inactive; preserveAspect; ] Care !!!!!!!! :[font = input; preserveAspect; ] Plot[ Tan[x], {x,0,2Pi}, AspectRatio -> Automatic] :[font = input; preserveAspect; ] lrect[ {x0_, y0_}, {x1_, y1_}] := Line[{{x0, y0}, {x1, y0}, {x1, y1}, {x0,y1}, {x0,y0}}] :[font = input; preserveAspect; ] arrow[ y_, {x0_, x1_}] := Module[{ len = (x1-x0)/4, xp, yp}, xp = x1 - len ; yp = len Tan[ Pi/4] ; {AbsoluteThickness[ 0.75], Line[ {{xp, y+yp}, {x1, y}, {xp, y-yp}}], AbsoluteThickness[1.0], Line[{{x0, y}, {x1, y}}]} ] :[font = input; preserveAspect; ] Show[ Graphics[{ Text[ {xmin, ymin}, {0,0}, {0,1.4}], Text[ {xmax, ymax}, {1,1}, {0,-1.4}], lrect[ {0,0}, {1,1}], Text[ {0, 0}, {2.5,0}, {0,1.4}], Text[ {1, AR}, {3.5,1}, {0,-1.4}], lrect[ {2.5, 0}, {3.5,1}], arrow[ 0.5, {1.375, 2.125}]}, AspectRatio -> Automatic, PlotRange -> All]] :[font = input; preserveAspect; endGroup; ] Show[ Graphics[{ PostScript["0.008 setlinewidth"], PostScript[" .1 .1 moveto"], PostScript[" .7 .9 .4 .3 .9 .1 curveto"], PostScript[" stroke"]}, Frame -> True, PlotRange -> {{0,1}, {0,0.061804}}]] :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] The Coordinate Area :[font = input; preserveAspect; ] Show[ Graphics[ { PointSize[ 0.02], Point[{5,10}]}, PlotRange -> {{0,10}, {0,20}}, Frame -> True]] :[font = input; preserveAspect; ] Show[ Graphics[{ Line[{{0,0}, {1,1}}], Text["This is a rather long string", {2,2}]}]] :[font = input; preserveAspect; ] Show[ Graphics[{ Line[{{0,0}, {1,1}}], Text["This is a rather long string", {2,2}, {1,1}]}]] :[font = input; preserveAspect; endGroup; ] Show[ Graphics[{ Line[{{0,0}, {1,1}}], Text["This is a rather long string", {2,2}]}, PlotRange -> All]] :[font = subsection; inactive; Cclosed; preserveAspect; startGroup; ] PlotRegion :[font = input; preserveAspect; endGroup; endGroup; ] DensityPlot[ Sin[x y], {x,0,2Pi}, {y,0,2Pi}, PlotRegion -> {{0.25, 0.75}, {0.25, 0.75}}] :[font = section; inactive; Cclosed; preserveAspect; startGroup; ] Mathematica Graphics Coordinate Systems II ;[s] 2:0,0;11,1;43,-1; 2:1,17,13,Times,3,18,0,0,0;1,16,12,Times,1,18,0,0,0; :[font = subsection; inactive; preserveAspect; startGroup; ] BoxRatios :[font = input; preserveAspect; ] Show[ Graphics3D[ Cuboid[{0,0,0}, {1,2,5}], BoxRatios -> {1,1,1}]] :[font = input; preserveAspect; endGroup; ] Show[%, BoxRatios -> Automatic] :[font = subsection; inactive; preserveAspect; startGroup; ] Projection :[font = input; preserveAspect; ] Show[ Graphics3D[{ PointSize[.04], Text["Projection\n Point", {-.2,-.5,-.5},{-.6,0}], Point[{0,0,0}], Text["Projection\n Plane", {-1, 2.1, 2.1},{1,-1}], Polygon[{{-1,2,2}, {-1,-2,2}, {-1,-2,-2}, {-1,2,-2}}], Thickness[0.01], Line[{{-1, -.5, -.5}, {-1, .5, .5}}], Line[{{-3, -1.5, -1.5}, {-4, 2,2}}], Thickness[.001], Line[{{-3, -1.5, -1.5}, {0,0,0},{-4, 2,2}}]}, Boxed -> False]] :[font = input; preserveAspect; ] < % / 2.3999] :[font = input; preserveAspect; ] Plot3D[ x y, {x,0,2}, {y,0,2}] :[font = input; preserveAspect; endGroup; endGroup; endGroup; ] Show[%, ViewVertical -> {0,1,0}] ^*)