Visualization - Maple Programming Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : System : Information : Updates : Maple 2019 : updates/Maple2019/Visualization


Maple 2019 includes a couple new plotting utilities for drawing mathematical shapes


Polygons by Name

Generalized Superellipses

Improved Visualization of Graphs


Animations in the Plot Builder

Plot Export

Polygons by Name

The new command plottools,polygonbyname draws shapes in plots. It knows about many mathematical shapes and has many options for creating them exactly as desired. This command is very useful for annotating other plots or building more complex 2-D visualizations. For example, it is used by GraphTheory,DrawGraph to render custom vertex shapes in Graph visualizations.


withplots: withplottools: setoptions axes=none, scaling=constrained, size=400,400 

The size of shapes is primarily controlled by defining the dimensions of a box that should fit entirely inside the shape. Here is a parallelogram that fits a 16x9 box.

displaypolygonbynameparallelogram, inbox=16,9, color=Red, axes=boxed

Regular polygons with an arbitrary number of sides can be specified by just a number for the name, or as "n-gon", or common name like "hexagon". Here is an animation of calling polygonbyname on the integers 3-36.

inscribedCircle  displaypolygonbynamecircle, radius=1, color=Blue, style=line:displayseqdisplayinscribedCircle,polygonbynamei, radius=1, style=line, i=3..36, insequence;

In addition to being able to specify the size of the polygon, you can specify its position with the center option and its orientation with the rotation option.

display  polygonbynameinvtriangle, center=3,0,  polygonbynametriangle, center=0,0,  polygonbynametriangle, center=3,0, rotation=90 degrees,size=600,200, style=line, linestyle=dash;

There many other ways to modify the shape with command options: irregular, reuleaux, rounded, star, and wide. Not all options, or combinations of options, are supported for every shape. See the help page for details.

inscribedCircle  displaypolygonbynamecircle, color=Blue, style=line:inscribedBoxdisplaypolygonbynamerectangle,color=Red,style=line:

displayinscribedBox,inscribedCircle, polygonbynameoctagon, star,  color=Linen ;


display polygonbynamehexagon, color=Linen, rounded 

display polygonbynamereuleaux hexagon, color=Linen 


displaypolygonbyname7gon, wide, color=Linen 

Most of these command options can also be specified as part of the name. Here is a wide irregular 9 pointed star.

displaypolygonbynamewide irregular 9-star, color=Linen 

Many shapes commonly used in diagrams are known by name.

plots:-displaymapsdisplaypolygonbynames, color=Linen,title=s, Array1..4,1..5,circle, semicircle, ellipse, star, stadium, half stadium, indent stadium, superellipse, supercircle, rectangle, square, parallelogram, trapezoid, rectangle, diamond, kite, invkite, dart, rhombus,triangle;


Generalized Superellipses

The plottools,ellipse and plottools,ellipticArc commands now have a super option that creates superellipses and generalized superellipses or arcs thereof. A generalized superellipse is the locus of points [x,y] satisfying the equation


for center [x0,y0], radial distances a and b, and super elliptic parameters m1 and m2. If m1m2 the curve is a generalized superellipse, and just a superellipse otherwise.



ms  15,13,12,23, 1, 32, 2, 3, 5:display(seq(ellipse(super=msi, legend=catm=,msi, color=Niagara i), i=1..nopsms), scaling=constrained, size=600,600);

Generalized superellipses have different shapes in the x and y directions. This is most obvious when one of the parameters is less than 1 and the other is greater.

display ellipsesuper=1/5,3,color=DarkRed, ellipsesuper=2,5,color=DarkBlue,scaling=constrained, size=600,600

Improved Visualization of Graphs

Many improvements have been made to the rendering of graphs with the DrawGraph command. As well, many new option have been added to customize the style of graphs. For full details see the GraphTheory updates page.

restart;withGraphTheory:GV1 Graph1,2,1, 2,3,2, 3,4,3, 4,5,4, 5,1,5;

GV1Graph 1: a directed weighted graph with 5 vertices and 5 arc(s)


DrawGraphGV1, stylesheet=vertexshape=squircle,edgethickness=3, vertexcolor=Red, arrowpos=0.1,arrowsize=25,weightfontsize=25,vertexfontsize=25



The Correlogram command in the Statistics package computes autocorrelations of a data set and displays the result as a column plot with dashed lines indicating the 95% confidence band. AutoCorrelationPlot is an alias for the Correlogram command.

Statistics:-CorrelogramImportdatasets/sunspots.csv,base=datadir,output=Matrix265..310, 2

Animations in the Plot Builder

You can now build animations interactively through the Plot Builder.


From the Context Panel for an expression, select Plot Builder.


Select the animation toggle button to create an animation.




Specify options as desired in the panel.


Click build animation.


To play the animation, use the animation toolbar.


Note: If you are animating a plot with more than one parameterized variable, you can change the sequence order of these variables using the options in the context panel:

Plot Export

It is now possible to export plots to the Scalable Vector Graphics (SVG) file format.