Function: math[seqplot] - plots a sequence
Calling Sequence:
seqplot(f, x=a .. b, v, plotoptions, seqplotoptions);
seqplot(f, x, v, plotoptions, seqplotoptions);
Parameters:
f
- any algebraic expression
x
- name of the indeterminate in f
a, b
- interval [a, b] to be plotted; a, b of type numeric
v
- (optional) a vertical range of the form y=c .. d or c .. d
plotoptions
- (optional) sequence of
plotoptions
seqplotoptions
- (optional) special seqplot plot options
Description:
This procedure facilitates plotting sequences and its function is the following:
seqplot(f, x=a..b) = plot([seq([x, f], x=a .. b)]
In the first form, seqplot displays all elements a through b. In the second form, by only giving the name of the indeterminate in f, all elements 1 through 10 are printed. Thus
seqplot(f, x, options) = seqplot(f, x=1 .. 10, options).
If you pass the vertical plot range (see ? plot,range ) as an equation of type name = range, the label for the vertical axis is determined from the name in the equation.
If the third argument is just a range or no vertical range is given, the label for the vertical axis is: `a[ <name in horizontal range > ]`.
You may pass any valid Maple plotoptions to seqplot; defaults are: style=point and symbol=diamond.
If you pass other values for plot options style and symbol, the default values are replaced with your settings.
Horizontal tickmarks are adapted to integers.
By passing the special option 'plotlimit' or 'limit', in addition to the sequence f the limit l of the function f evaluated is plotted as a horizontal line in red color (default), provided that limit l exists. You may set the default color for this line by assigning any valid Maple color to the global variable seqplotLimitColor . You may also specify another color for the `limiting line` by passing the argument 'plotlimit'=<color> where <color> is any Maple color.
Also you may pass the equation 'plotlimit'=<list of plot options> to seqplot to have more control on the display of the limit.
The 'tangents' option plots horizontal lines to the elements of the sequence. The default line color is gray. You may set the default color for the lines by assigning any valid Maple color to the global variable seqplotTangentColor . You may also specify another color by passing the argument 'tangents'=<color> where <color> is any Maple color.
Also you may pass the equation 'tangents'=<list of plot options> to seqplot to have more control on the display of the horizontal lines.
This function is part of the math package, and so can be used only after performing the command with(math) or with(math, seqplot).
Examples:
> restart: with(math, seqplot):
>
### WARNING: the definition of the type `symbol` has changed'; see help page for details
seqplot(1/q, q=1 .. 10, symbol=CROSS, color=navy);
> f := n -> (1+1/n)^n:
> seqplot(f(n), n=1 .. 100, xtickmarks=10, labels=[`n`, `f[n]`]);
> seqplot((-1)^k/(k+1), k=1 .. 100, y=-1 .. 1, axes=frame, 'limit', xtickmarks=10);
> seqplot(k/(k^2)+1, k=1 .. 20, y=0 .. 5, limit=black);
>
seqplot(1/k+1, k, y=0.5 .. 3,
limit=[color=darkcyan, linestyle=2],
tangents=[linestyle=3],
labels=[`k`, `a[k]`],
titlefont=[HELVETICA, BOLD, 12],
title = `A convergent sequence`);
See Also:
plot , math/gridplot .
Version History:
Version 1.0 current as of April 1996
Version 1.1 current as of April 7, 1997
Version 1.2 current as of May 7, 1997
Version 1.3 current as of December 21, 1997
Version 1.4 current as of February 07, 1998
Version 1.5 current as of February 23, 1998
Version 1.6 current as of April 21, 2000