 6.21 Setting Plot Options - Maple T.A. 2016 Help Instructor
Select your version: Maple T.A. 2017 | Maple T.A. 2016 | Maple T.A. 10

6.21 Setting Plot Options

2-D Plot Statement Options

The options to the Maple plot command are given after the function(s), horizontal range, and vertical range, as equations of the form option = value.

For example,

`plotmaple("plot(sin(x), x=-Pi..Pi, filled=true, title=`My Plot`)");`

The options described below are supported.

Table 6.17: Options for 2-D Plots

Option

Description

When plotting a function over an interval, the interval is sampled at a number of points, controlled by sample and numpoints. Adaptive plotting, where necessary, subdivides these intervals to attempt to get a better representation of the function. This subsampling can be turned off by setting the adaptive option to false. By default, this option is set to true, and intervals are subdivided at most 6 times in trying to improve the plot. By setting this option to a non-negative integer, you can control the maximum number of times that subintervals are divided.

axes=f

Specifies the type of axes, one of: boxed, frame, none, or normal. The value can be in lowercase or uppercase.

color=n or colour=n

Allows the user to specify the color of the curves to be plotted.

coords=<name>

Indicates that a parametric plot is in the coordinate system specified by <coord_name>.

discont=s

Setting s to true forces plot to call the function discont first to determine the discontinuities of the input (or fdiscont if discont fails or if the input is not an expression) and then breaks the horizontal axis into appropriate intervals where the expression is either continuous or contains only removable discontinuities.

filled=truefalse

If the filled option is set to true, the area between the curve and the x-axis is given a solid color. This option is valid only with the following commands: plot, contourplot, implicitplot, listcontplot, polarplot, and semilogplot.

labels=[x,y]

This option specifies labels for the axes. The values of x and y must be strings. The default labels are the names of the variables in the original function to be plotted, if any. The strings must be entered using left single quotes.

labeldirections=[x,y]

This option specifies the direction in which labels are printed along the axes. The values of x and y must be horizontal or vertical. The default direction of any labels is horizontal. The value can be in lowercase or uppercase.

legend=s

A legend for a plot can be specified by either a string or a list of strings. When more than one curve is being plotted then they must be specified as a list (and not a set) and there must be a legend for each curve where the ith curve is associated with the ith legend. The strings must be entered using left single quotes.

linestyle=n

Controls the dash pattern used to render lines in the plot. The linestyle can be specified as either an integer between 1 and 4, or a name from the following list: SOLID, DOT, DASH, or DASHDOT. The value must be in uppercase.

numpoints=n

Specifies the minimum number of points to be generated. The default is 50. Note: plot employs an adaptive plotting scheme which automatically does more work where the function values do not lie close to a straight line. Hence, plot often generates more than the minimum number of points.

resolution=n

Sets the horizontal display resolution of the device in pixels (the default is n = 200). The value of n is used to determine when the adaptive plotting scheme terminates. A higher value results in more function evaluations for non-smooth functions.

sample

A list of values which is to be used for the initial sampling of the function(s). When coupled with adaptive=false, this option allows explicit control over the function evaluations performed by plot.

scaling=s

Controls the scaling of the graph as constrained or unconstrained. The default value is unconstrained. The value can be in lowercase or uppercase.

style=s

The interpolation style must be one of line, patch, patchnogrid, or point. The default is line. The value can be in lowercase or uppercase. The point style plots points only, line interpolates between the points, patch uses the patch style for plots containing polygons, and patchnogrid is the patch style without the grid lines.

symbol=s

Symbol for points in the plot, where the value s is one of box, circle, cross, diamond, or point. The value can be lowercase or uppercase. Note: If the style is set to point, the default symbol is plot device specific.

symbolsize=n

The size (in points) of a symbol used in plotting can be given by a positive integer. This does not affect the symbol POINT. The default symbol size is 10.

thickness=n

This option specifies the thickness of lines in the plot. The thickness n must be a non-negative integer. The default thickness is 0.

tickmarks=[m,n]

If m is an integer, then this option controls the number of tickmarks that are placed on the x-axis. If m is a list of numeric values, then tickmarks are placed only at the specified values. If m is a list of equations v=t, where v is a numeric value and t is a name or string, then a tickmark with the label t is placed at v. If m is the name default, then the default tickmark placement is applied. Similarly, n specifies the placement of y-axis tickmarks. This option can be replaced by the xtickmarks=m or ytickmarks=n option if you wish to specify tickmarks for one axis only.

title=t

The title for the plot. The value t must be a character string. The default is no title. You can create multi-line titles for standard plots. Use the characters \n in the character string to denote the start of a new title line. The strings must be entered using left single quotes.

view=[xmin..xmax, ymin..ymax]

This option indicates the minimum and maximum coordinates of the curve to be displayed on the screen. The default is the entire curve.

xtickmarks=m

See the description for the tickmarks option.

ytickmarks=n

See the description for the tickmarks option.

plotmaple(text)

3-D Plot Statement Options

Options to the Maple plot3d function are given after the first three arguments, as equations of the form option = value.

For example,

```plotmaple("plot3d(sin(x)*y, x=-Pi..Pi, y=-1..1, lightmodel=light1)");
```

The options described below are supported.

Table 6.18: Option for 3-D Plots

Option

Description

ambientlight=[r, g, b]

This option sets the red, green, and blue intensity of the ambient light for user defined lighting. The values of r, g, and b must be numeric in the range 0 to 1.

axes=f

This option specifies how the axes are to be drawn, where f is one of boxed, normal, frame, or none. The default value is none. The value can be in lowercase or uppercase.

color=c or colour=c

This option defines a color value or function. Note that color specification takes precedence over shading specification, regardless of the order of the options in the command.

contours=n

This option specifies the number of contours or a list of contour values, where n is a positive integer or a list of contour values. The default value is 10.

coords=c

This option specifies the coordinate system to be used. The default is Cartesian.

filled=truefalse

If the filled option is set to true, the region between the surface and the xy-plane is displayed as solid. This option is valid only with the following commands: plot3d, contourplot3d, and listcontplot3d.

grid=[m,n]

This option specifies the dimensions of a rectangular grid on which the points are generated (equally spaced).

gridstyle=x

This option specifies a grid x as either rectangular or triangular. This option is not available for all 3-D plot objects.

labeldirections=[x,y,z]

This option specifies the direction in which labels are printed along the axes. The values of x, y, and z must be horizontal or vertical. The default direction of any labels is horizontal. The value can be in lowercase or uppercase. The axes option must be set to boxed, frame, or normal.

labels=[x,y,z]

This option specifies labels for the axes. The value of x, y, and z must be a string. The default labels are the names of the variables in the original function to be plotted. The strings must be entered using left single quotes.

light=[phi, theta, r, g, b]

This option adds a directed light source from the direction phi, theta in spherical coordinates with red, green, and blue intensities given by r, g, and b. The values of r, g, and b must be numeric in the range 0 to 1.

lightmodel=x

This option chooses a predefined light model to illuminate the plot. Valid light models include none, light1, light2, light3, and light4. The value must be in lowercase.

linestyle=n

This option controls the dash pattern used to render lines in the plot. The linestyle can be specified as either an integer between 1 and 4, or a name from the following list: SOLID, DOT, DASH, and DASHDOT. The value must be in uppercase.

numpoints=n

This option specifies the minimum total number of points to be generated (default 625 = 25^2). The plot3d command uses a rectangular grid of dimension isqrt(n+3)+1.

orientation=[theta, phi]

This option specifies the theta and phi angles of the point in three dimensions from which the plot is to be viewed. The default is at a point that is out perpendicular from the screen (negative z axis) so that the entire surface can be seen. The point is described in spherical coordinates where theta and phi are angles in degrees, with default 45 degrees in each case.

projection=r

This option specifies the perspective from which the surface is viewed, where r is a real number between 0 and 1. The 1 denotes orthogonal projection, and the 0 denotes wide-angle perspective rendering. r can also be the one of the names, fisheye, normal, or orthogonal, which correspond to the projection values 0, 0.5, and 1, respectively. The default is orthogonal. The value can be in lowercase or uppercase.

scaling=s

This option specifies whether the surface should be scaled so that it fits the screen with axes using a relative or absolute scaling, where s is either unconstrained or constrained. The default is relative unconstrained. The value can be in lowercase or uppercase.

This option specifies how the surface is colored, where s is one of xyz, xy, z, zgrayscale, zhue, or none. The default is device dependent. The value can be lowercase or uppercase. Note that color specification takes precedence over shading specification, regardless of the order of the options in the command. The value can be in lowercase or uppercase.

style=s

This specifies how the surface is to be drawn, where s is one of contour, hidden, line, patch, patchcontour, patchnogrid, point, or wireframe. Some of the options may not be available on some devices. The default style is patch (for colored surface patch rendering). The value can be in lowercase or uppercase.

symbol=s

This option defines the symbol for points in the plot. s is one of box, circle, cross, diamond, or point. The value can be in lowercase or uppercase. Note: If the style is set to point, the default symbol is plot device specific.

symbolsize=n

The size (in points) of a symbol used in plotting can be given by a positive integer. This does not affect the symbol point. The default symbol size is 10.

thickness=n

This option specifies the thickness of lines in the plot. The thickness n must be a non-negative integer. The default thickness is 0.

tickmarks=[m,n,p]

If m is an integer, then this option controls the number of tickmarks that are placed on the x-axis. If m is a list of numeric values, then tickmarks are placed only at the specified values. If m is a list of equations v=t, where v is a numeric value and t is a name or string, then a tickmark with the label t is placed at v. If m is the name default, then the default tickmark placement is applied. Similarly, n specifies the placement of y-axis tickmarks and p specifies the placement of z-axis tickmarks.

title=t

This option specifies a title for the plot. The value of t must be a string. The default is no title. You can create multi-line titles for standard plots. Use the characters \n to denote the start of a new title line. The strings must be entered using left single quotes.

view=zmin..zmax

or [xmin..xmax, ymin..ymax, zmin..zmax]

This option indicates the minimum and maximum coordinates of the surface to be displayed on the screen. The default is the entire surface.