Efficient Computation with Plotting Commands - Maple Programming Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Graphics : plot/computation

Efficient Computation with Plotting Commands


This help page provides details about how numeric computation is performed by Maple's plotting commands.  Included are suggestions on how to get the most efficient performance from the commands.


The Floating-Point Environment

Plot Data Structures

Complex Values


The Floating-Point Environment


The plotting commands attempt to evaluate the input expressions or procedures using the floating-point hardware of the underlying system whenever possible. This is done through calls to the evalhf command.  If the environment variable Digits is greater than the value of evalhfDigits, or if an initial attempt using evalhf fails, then the slower evalf command is used for numerical evaluation.


To maximize efficiency, expressions and procedures passed to plotting commands should be written so that they can be evaluated by evalhf if possible. For more information on the functions and constructs supported by evalhf, see the evalhf/procedure and evalhf/fcnlist help pages.

Plot Data Structures


The data structure used for storing plots is described on the plot/structure help page.  Most plot structures allow the data to be stored in either a list or an rtable.  It is recommended that you build plot structures through the commands in the plotting library, which include the plot and plot3d commands and the plots and plottools packages.  However, if you wish to build the plot structures directly, then rtables should be used for those structures that support them, and they should be created with the datatype=float and order=C_order options.

Complex Values


Most of Maple's plotting commands are meant to work with real-valued functions, though there exist specialized commands such as plots[complexplot] for plotting complex-valued functions.  Generally, when evaluation of the input expression or procedure results in a complex value, the value is replaced by an undefined value.  Many plotting commands check for numbers with very small imaginary parts and will convert these numbers to real numbers, with the criteria for dropping an imaginary part depending on the Digits environment variable and on its relative size compared to the real part. This procedure helps to avoid problems caused by round-off errors during the computation.



If the function to be plotted has a discontinuity, then evaluation at the point of discontinuity will lead to an undefined value, which results in a gap in the plotted curve or surface.  More often, the function is evaluated at points very close to the discontinuity, and this leads to a distorted view of the plot when the values are extremely large or small and an inappropriate connecting of the points over the discontinuity.


In the 2-D case, the discont=true option can be used with the plot command when you suspect a discontinuity. For more information, see plot/discont.


The discont option is not available in the 3-D case.  In this situation, it is recommended that you divide the plotting ranges into subranges to avoid the discontinuities, generate the individual plots and then combine them using the plots[display] command.  The view option can be used to control the ranges in the final display.

See Also