Visualization - New Features in Maple 2019 - Maplesoft

What's New in Maple 2019

Visualization


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


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. 

 

> with(plots); -1; with(plottools); -1; setoptions(axes =
 

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. 

> display(polygonbyname(
 

Plot_2d
 

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 := display(polygonbyname(
inscribedCircle := display(polygonbyname(
 

Plot_2d
 

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(polygonbyname(
display(polygonbyname(
display(polygonbyname(
display(polygonbyname(
display(polygonbyname(
display(polygonbyname(
 

Plot_2d
 

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 := display(polygonbyname(
inscribedCircle := display(polygonbyname(
 

> display(inscribedBox, inscribedCircle, polygonbyname(
 

Plot_2d
 

 

> display(polygonbyname(
 

Plot_2d
 

> display(polygonbyname(
 

Plot_2d
 

 

> display(polygonbyname(
 

Plot_2d
 

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

> display(polygonbyname(
 

Plot_2d
 

Many shapes commonly used in diagrams are known by name. 

>

 

Plot_2d Plot_2d Plot_2d Plot_2d Plot_2d
Plot_2d Plot_2d Plot_2d Plot_2d Plot_2d
Plot_2d Plot_2d Plot_2d Plot_2d Plot_2d
Plot_2d Plot_2d Plot_2d Plot_2d Plot_2d

 

 

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 

`+`(`^`(abs(`/`(`*`(`+`(x, `-`(x0))), `*`(a))), m1), `^`(abs(`/`(`*`(`+`(y, `-`(y0))), `*`(b))), m2)) = 1 

`+`(`^`(abs(`/`(`*`(`+`(x, `-`(x0))), `*`(a))), m1), `^`(abs(`/`(`*`(`+`(y, `-`(y0))), `*`(b))), m2)) = 1
 

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

`<>`(m1, m2)
 

 

 

> ms := [`/`(1, 5), `/`(1, 3), `/`(1, 2), `/`(2, 3), 1, `/`(3, 2), 2, 3, 5]; -1; display(seq(ellipse(super = ms[i], legend = cat(
ms := [`/`(1, 5), `/`(1, 3), `/`(1, 2), `/`(2, 3), 1, `/`(3, 2), 2, 3, 5]; -1; display(seq(ellipse(super = ms[i], legend = cat(
ms := [`/`(1, 5), `/`(1, 3), `/`(1, 2), `/`(2, 3), 1, `/`(3, 2), 2, 3, 5]; -1; display(seq(ellipse(super = ms[i], legend = cat(
 

Plot_2d
 

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(ellipse(super = [`/`(1, 5), 3], color =
 

Plot_2d
 

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; 1; with(GraphTheory); -1; GV1 := Graph({[[1, 2], 1], [[2, 3], 2], [[3, 4], 3], [[4, 5], 4], [[5, 1], 5]}); 1
 

Typesetting:-mprintslash([GV1 := `Graph 1: a directed weighted graph with 5 vertices and 5 arc(s)`], [GRAPHLN(directed, weighted, [1, 2, 3, 4, 5], Array(%id = 18446744074791222078), `GRAPHLN/table/1`,...
 

> DrawGraph(GV1, stylesheet = [vertexshape =
DrawGraph(GV1, stylesheet = [vertexshape =
 

Plot_2d
 

 

Correlogram 

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:-Correlogram(Import(
 

Plot_2d
 

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.
 

Image 

 

  • Specify options as desired in the panel. To play the animation, use the animation toolbar.
 

 

Image 

 

Plot Export 

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