This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Add-ons & Links / Standard Packages / Introduction /

Graphics and Geometry Packages

The Graphics packages offer log, polar, error, scatter, vector field, surface of revolution, three-dimensional contour, and implicit plots. Functions include maps for visualizing complex functions of complex numbers, and bar and pie charts for visualizing data. Mathematica's built-in graphics are enhanced by arrow, legend, and color directives, and by two-dimensional spline primitives and three-dimensional shape primitives. There are functions for the stellation and geodesation of regular polyhedra, animation of a sequence of graphics, and support for the 3-Script file format. The Geometry packages provide functions giving the characteristics of regular polygons and polyhedra and rotation in two and three dimensions.

This causes each Graphics package to be loaded as functions from the package are needed.

In[1]:= <<Graphics`

Here is a pie chart of the distribution of certain Mathematica users by field.

In[2]:= (styles = Map[Hue, Range[0, 10]/10 .7];
ShowLegend[
PieChart[ {29, 20, 16, 16, 5, 4, 3, 2, 1, 1, 4},
PieStyle -> styles, PieLabels -> Join[
{"Engineering", "Physical Sciences",
"Computer Sciences", "Mathematical Sciences"},
Table["", {7}]], DisplayFunction -> Identity],
{Transpose[{Drop[styles, 4],
{"Life Sciences", "Business Finance",
"Administration", "Social Sciences",
"Arts Humanities", "Technology", "Other"}
}], LegendTextSpace -> 8, LegendPosition->{.5, -1},
LegendShadow->{0, 0}},
ImageSize -> {370, 370}
])

Out[2]=

This gives a histogram of the number of primes near four different values of . The bin widths are proportional to in each case.

In[3]:= (t = Map[ (w = 25 Log[#];
Table[PrimePi[# + j w] - PrimePi[# + (j-1)w],
{j, -3, 4}])&, 10^(1 + 2Range[4])];
BarChart3D[t, XSpacing -> .8,
Ticks -> {{{1, 10^3}, {2, 10^5}, {3, 10^7}, {4, 10^9}},
None, Automatic}])

Out[3]=

Here scattering cross section () is plotted versus the incident momentum of a particle beam (GeV/c), measured in a laboratory frame of reference. The estimated standard deviation of the cross section at each value of the incident momentum is indicated using error bars.

In[4]:=

Out[4]=

Here is the Wolfcamp aquifer data again, this time displayed as a scatter plot.

In[5]:= (data = ReadList["wolfcamp.aquifer.data",
Number, RecordLists->True];
ScatterPlot3D[data, BoxRatios->{1, 1, .3}, Axes -> True,
ViewPoint -> {1.3, 2.4, 2.}])

Out[5]=

Load the statistics packages so distribution formulas can be used.

In[6]:= Needs["Statistics`"]

You can visualize the two-parameter gamma probability density function by creating a row of stacked graphics. A function having three parameters can be visualized using a two-dimensional array of stacked graphics.

In[7]:=

Out[7]=

This initializes the Geometry packages.

In[8]:= <<Geometry`

Here the regular polyhedra are plotted according to number of faces, number of edges, and volume when edges have unit length.

In[9]:= Apply[Show,
Join[
Map[Polyhedron[#, {NumberOfFaces[#], NumberOfEdges[#],
Volume[#]}, .7]&,
{Tetrahedron, Cube, Octahedron, Dodecahedron,
Icosahedron}],
{Axes -> True, AxesLabel -> {"# of faces", "# of edges",
"volume"},
Ticks -> {{4, 6, 8, 12, 20}, {6, 12, 12, 30, 30},
Automatic}}] ]

Out[9]=