tickmarks - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Graphics : 2-D : Options : tickmarks

Plot Tickmarks and Gridlines


Options for Controlling Tickmarks and Gridlines

Specifying Tickmarks/Gridlines for a Single Axis

Suboptions of the tickmarks or gridline Option




Options for Controlling Tickmarks and Gridlines


Tickmarks and gridlines on plots can be specified with the tickmarks and gridlines suboptions of the axis option. Restricted forms of the tickmarks and gridlines option may also be given directly to a plotting command, outside of the axis option. For more information, see the plot/option and plot3d/option help pages.  Note that gridlines are available for 2-D plots only.

Specifying Tickmarks/Gridlines for a Single Axis


When using the axis option, the tickmarks or gridlines for a single axis can be specified using the tickmarks=s or gridlines=s option.  The tickmark specification for all axes may be given through a single tickmarks=[s1, s2] or tickmarks=[s1, s2, s3] option for 2-D and 3-D plots respectively, where s1, s2 and s3 have the same form as s.


The tickmarks or gridlines value s can take one of the following forms.  For brevity, the statements below refer only to tickmarks but they apply to gridlines as well.


non-negative integer


This controls the number of tickmarks appearing on the axis.  Maple attempts to use a number of tickmarks as close as possible to the value requested while ensuring a reasonable gap between the tickmarks.


list of numeric values


Tickmarks are placed at the exact locations specified by the numeric values.


list of equations


For each equation v=t, where v is a numeric value, a tickmark with label t is placed at the exact location specified by v. For information on how to specify labels, see plot/typesetting.


the name piticks, decimalticks or default


The name piticks produces tickmarks in multiples of π. The name decimalticks or default produces numeric tickmarks. These names apply to the tickmarks option only and are ignored by the gridlines option.


a spacing(g, f) structure


If you specify spacing(g, f), tickmarks are drawn with a gap of g between every two, where g is a numeric value.  The optional numeric value f specifies a fixed location where a tickmark is to be placed; other tickmarks are then drawn relative to this point.


The argument g or f may also have the form c*u where c is a numeric value and u is a name that evaluates to a numeric value when evalf is applied.  In this case, the tickmarks labels will use the name u and this name will be typeset as described in plot/typesetting.  This allows you to label tickmarks with multiples of Pi, for example.


You can also define a new constant and extend the evalf command to evaluate it. This constant can then be used in the spacing structure.  For more information, see evalf/details.

Suboptions of the tickmarks or gridline Option


The value s can also be a list consisting of a tickmark or gridline specification as described above, followed by one or more suboptions.  This form for s is available only when the tickmarks or gridlines suboption appears inside the axis option.


Note that tickmarks=[n], where n is an integer, is always interpreted as a tickmark at location n. To get n tickmarks, use tickmarks=n or tickmarks=[n, w], where w is a sequence of one or more suboptions.


The available suboptions are listed below.


color=c or colour=c


Specify the color of the tickmarks or gridlines.  See the plot/color help page for a description of the values that c can take.




Specify the line style. This option applies to gridlines only.  The value t can be one of the following names:  solid, dot, dash, dashdot, longdash, spacedash, spacedot.  The default value is solid. The value t can also be the name ticks, in which case tickmarks rather than gridlines are drawn.




Specify the placement of major lines. This option applies to gridlines only. Every mth gridline is heavier, where m is a positive integer.  The default is m=1.




Specify the angle of rotation for tickmark labels. The value r must evaluate to a real number that is assumed to be in radians or be one of the names horizontal (equivalent to 0 radians) or vertical (equivalent to π2 radians).


subticks or subticks=t


Control the display of subticks between tickmarks or gridlines.  The value t can be true (default subticks are displayed), false (no subticks are displayed), or a non-negative integer specifying the exact number of subticks between two gridlines or tickmarks.




Specify the thickness of tickmarks or gridlines.  The value t must be a positive integer.  The default is t=1.



The axis option, the gridlines option, and the spacing feature of the tickmarks option are not available for all interfaces.  For more information, see plot/interface. Gridlines are available for 2-D plots only.


In some situations, Maple adds the tickmarks option with value piticks automatically. For example, π tickmarks will appear for a plot of sin(x). If π tickmarks are not desired in any of these cases, specify decimalticks to override the default behavior.


Put 10 tickmarks on each axis.


Put tickmarks at specific locations on the x-axis and use default tickmarks on the y-axis.


Define labels at specific locations.


Use the seq command to generate a sequence of tickmark labels.


Specify tickmarks in multiples of π on the vertical axis.


Add default gridlines to a plot.


Draw blue gridlines.


Put three subticks between every two tickmarks.


Use a tickmark spacing of π2 on the x-axis.


Define a constant Ζ and label the y-axis with multiples of this constant.



Rotate tickmarks by -Pi/4.




The piticks and decimalticks options were introduced in Maple 15.


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


The rotation option was introduced in Maple 2018.


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

See Also