Plot Annotations - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : 2-D : Options : plot/annotation

Plot Annotations

 

Calling Sequence

Parameters

Summary

The annotation Option

Including Coordinate Values

Examples

Compatibility

Calling Sequence

plotcommand(plotargs, annotation=t)

plotcommand(plotargs, annotation=A)

Parameters

plotargs

-

arguments to a plotting command

t

-

an annotation

A

-

an Array of annotations

Summary

• 

Use the annotation option to add descriptive text that appears when the pointer hovers over a curve or a point.

plot(sin(x), x=0..2*Pi, annotation="a sine curve");

The annotation Option

• 

The annotation option allows you to add descriptive text to a 2-D curve or point plot. The term "point plot" in this context means a collection of points that are treated as a single plot element, such as that created by the plots:-pointplot or dataplot command.  The text, which can include mathematical expressions, appears when the pointer hovers over the plot element to which it is associated.

• 

In the first calling sequence, t can be any Maple expression that can be typeset. See the plot/typesetting help page for more information about how such expressions can be specified. In this case, t is displayed whenever the pointer hovers over any part of the curve or point plot.

• 

In the second calling sequence, A is an Array of n values, where n is the number of points defining a curve or in a single point plot. This form of the option does not work with curves consisting of disconnected parts, such as those formed using the discont option or the plots:-implicitplot command.

Including Coordinate Values

• 

You can include the x-coordinate or y-coordinate associated with the location over which the pointer hovers in an annotation. To do this, use the name xcoordinate or ycoordinate as the annotation value or within a typeset structure as described on the plot/typesetting help page.

• 

If you want to use a function of either the x-coordinate or y-coordinate, then use xcoordinate(p) or ycoordinate(p) where p is a procedure that accepts a numeric value and returns a numeric value, such as u->u^2.

• 

To use a function of both coordinates, use xycoordinate(p) where p is a procedure that accepts two numeric values (the x-coordinate and y-coordinate, respectively) and returns a numeric value, such as (u,v)->u*v.

• 

The number of digits displayed for the x-coordinate or y-coordinate can be specified by adding the digits=n option after the procedure p. Note that p can be omitted, as in xcoordinate(digits=5).

Examples

Add an annotation to a curve.

plotx2,x=0..1,annotation=typesetthe function ,x2

Add an annotation to each point in a data plot.

dataplotMatrix0,0,1,2,2,3,3,2,4,4,points,annotation=ArrayJanuary,February,March,April,May

Include coordinate values.

plotx2,x=0..1,annotation=typesetthe square of ,'xcoordinate', is ,'ycoordinate'

Use a function of the coordinate values and specify the number of digits.

plotx2,x=0..1,annotation=typesetthe sum of x and y coordinates is ,'xycoordinate'x,y→x+y,digits=5

Compatibility

• 

The annotation option was introduced in Maple 2017.

• 

For more information on Maple 2017 changes, see Updates in Maple 2017.

See Also

dataplot

plot

plot/options

plot/typesetting

plots:-pointplot