Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Adding Customized Items' topicStudent Support Forum > General > Archives > "Adding Customized Items"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
10/01/02 09:28am

Text, Arrows, Circles, etc. are called Graphics
Primitives in Mathematica. Most of these
are defined when the Kernel is launched. Arrows
are defined in one of the Standard AddOn packages.

You can load that package:

<<Graphics`Arrow`

and then do some drawing:

Show[Graphics[{Text["Here is an arrow pointing at a circle", {0, 1}],
Arrow[{.1, .9}, {.4, .6}], Circle[{.5, .5}, .1]}], PlotRange -> All]

You can add primitives to a plot using Epilog:

Plot[x, {x, 0, 1},
Epilog -> {Text["Here is the mid point of the line", {0, 1}],
Arrow[{.1, .9}, {.4, .6}], Circle[{.5, .5}, .1], PointSize[.05],
Point[{.5, .5}]}, PlotRange -> All]

Note the use of PlotRange in each case. In most
cases the setting All will suffice. At times,
however, you may need to specify the range
explicitly.

PointSize is an example of a Graphics Directive,
that is something that controls the appearance
of a Graphics "object."

You can also combine a plot and primitives using
Show:

In[29]:= gr=Plot[x, {x, 0, 1}]
In[30]:=
Show[{gr,
Graphics[{Text["Here is the mid point of the line",{0,1}],
Arrow[{.1,.9},{.4,.6}], Circle[{.5,.5},.1],PointSize[.05],
Point[{.5,.5}]}]}, PlotRange\[Rule] All]

Show, Graphics, Text, Arrow, Circle, etc. are
all discused in the documentation available in
the Help Browser.

URL: ,

Subject (listing for 'Adding Customized Items')
Author Date Posted
Adding Customized Items Alvin 09/29/02 1:44pm
Re: Adding Customized Items Forum Modera... 10/01/02 09:28am
< Previous CommentHelp | Reply To Comment | Reply To Topic