Maple 18 includes new and expanded tools to connect to and work with external data sources and file formats. These include new support for connecting with Internet data sources, support for importing from and exporting to popular 3-D graphics formats, and working with compressed files.


Connecting to URL Data Sources

The new URL package offers efficient tools for connecting to remote data sources using the HTTP, HTTP Secure (HTTPS), and FTP transfer protocols. For HTTP and Secure HTTP, both GET and POST operations are supported.

sitecontent := URL:-Get( 



As well, support for URLs has now been extended in many other places in Maple where filenames were previously supported, simplifying the steps necessary to connect to this data using Maple. 

fingerprint := ImageTools:-Read( 

Vector[column](%id = 18446744078100150622)


3-D Graphics Import/Export

The updated plottools package offers new tools and functionality for generating, importing, exporting 3-D graphic models in a variety of formats.

Importing and Exporting 3-D models

The new importplot and exportplot commands permit the exchange of 3-D geometric data between a variety of formats and Maple plots. After import, a geometric object can then be combined with other visualizations in Maple using existing tools such as plots[display].  The following new data formats are supported for both import and export: 


BYU - Movie.BYU geometry 

PLY - Stanford triangle format (ASCII & binary) 


JVX - JavaView geometry 

STL - Stereolithography file format (ASCII & binary) 


OBJ - Wavefront file format 

VTK - Visualization ToolKit file format 


OFF - Object File Format 



In addition to importing from a local file, importplot also allows the user to import directly from a URL. 

Import Examples

The following examples illustrate imports from PLY and STL file formats. 

gear := cat(kernelopts(datadir),
gear := cat(kernelopts(datadir),




figure :=
figure :=
figure :=



Export Examples

The following examples illustrate exporting Maple 3-D objects to BYU and OFF formats, then importing them back. 

f := `*`(`+`(`-`(`*`(`^`(x, 7))), `*`(`^`(y, 3))), `*`(`+`(`-`(`*`(2, `*`(`^`(x, 5)))), `*`(`^`(y, 2))))); -1 

knot := algcurves[plot_knot](f, x, y, epsilon = .8, radius = .1, tubepoints = 9, axes = none); -1
knot := algcurves[plot_knot](f, x, y, epsilon = .8, radius = .1, tubepoints = 9, axes = none); -1



surface := plot3d(`+`(sin(x), `*`(x, `*`(cos(y)))), x = -5 .. 5, y = -5 .. 5, color = purple); -1
surface := plot3d(`+`(sin(x), `*`(x, `*`(cos(y)))), x = -5 .. 5, y = -5 .. 5, color = purple); -1

plots:-display(surface, axes = none) 


KnotFile := cat(FileTools:-TemporaryDirectory(),
KnotFile := cat(FileTools:-TemporaryDirectory(),

plottools[exportplot](KnotFile, knot); -1 

SaddleFile := cat(FileTools:-TemporaryDirectory(),  

plottools[exportplot](SaddleFile, surface); -1 

plottools[importplot](KnotFile); 1 





Import and Export of Tabular and Spreadsheet Data

The improved ImportMatrix and ExportMatrix commands enable tabular and spreadsheet data in a variety of formats to be imported to and exported from Maple matrices. The following new data formats are supported for both import and export:


DIF - Data Interchange Format 

ODS - OpenDocument Spreadsheet 

SXC - Sun XML Calc spreadsheet 

These commands also now handle Excel spreadsheet files using the previously existing ExcelTools package. As a result, in total, they now support four additional formats. In addition to importing from a local file, ImportMatrix also supports importing data directly from a URL. 

ImportMatrix examples

excelOutput := cat(kernelopts(datadir),
excelOutput := cat(kernelopts(datadir),

excelData := ImportMatrix(excelOutput) 

Vector[column](%id = 18446744078186449246)

MapleTimeline :=
MapleTimeline :=
MapleTimeline :=

timelineData := ImportMatrix(MapleTimeline) 

Vector[column](%id = 18446744078186450086)

Imported Excel Data 

Embedded component 

Imported DIF Data 

Embedded component 


Compressed File Support

Maple 18 supports both zip and gzip file formats.

The gzip format allows lossless compression of data in a single file. Your large matrix can be written to a file using this format, thus taking up less room on disk compared to an ordinary uncompressed data file.

The zip format allows lossless compression of organized collection of data and resources in a single file. Think of it as a collection of files zipped together in a single archive. By splitting the data into a directory structure within the zip file, the data is better organized for easy extraction.

To use the short form of command names, we'll load the package:

with(FileTools:-Compressed); -1 

Reading Zip Files

Now, let's point to a sample zip file and look to see what is included inside it: 

zipfile := FileTools:-JoinPath([kernelopts(mapledir),  

Contents(zipfile); 1 


There are three files, we will read each of them in. 

The first file is stored with the suffix ".m", so it is immediately restored as a Maple object when read into Maple. 

data := ReadFile(`in`( 

Vector[column](%id = 18446744078186444670)

The second file is plain text. In this case we additionally use the parse command to turn the plain text into equations. 

opts := parse(ReadFile(`in`( 

axes = none, view = [-600 .. 300, -800 .. 100]

The third file is an image. We will extract it into a temporary directory. 

imagefile := cat(FileTools[TemporaryDirectory](),  


Now, let's plot the data, image, and options we just read in. 

plots[polygonplot](data, background = imagefile, opts); 1 


Creating and Writing to Zip Files

This short section will show how the sample zip file was created. 

Start with naming the container zip file -- "".  Individual files within the zip will be specified using in to separate the container name with the in-zip name. The data is already defined in the previous section, we'll write it out to a sub-file with a .m extension. 

newzipfile :=  



Here the options are written as plain text. 



The image is taken from the data directory on disk and put directly into the zip archive.  


We are done. Let's look to see what is inside our new zip file.  

Contents(newzipfile); 1 


This new zip file that we created can be read by standard tools like WinZip and pkzip. Similarly, files created using these tools can be opened and read by Maple. 


Export of Graphs to LaTeX

The new GraphTheory[Latex] command generates LaTeX code for displaying a graph using the LaTeX picture environment. It handles directed and undirected graphs in both black and white and color. The vertex labels are placed beside the vertices in the LaTeX picture.


> with(GraphTheory); -1
> with(SpecialGraphs); -1

We create an undirected unweighted soccer ball graph. 

> S := SoccerBallGraph(); 1
GRAPHLN(undirected, unweighted, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, ...
> DrawGraph(S); 1

Here we export the soccer ball graph S to a compilable LaTeX file. 


Finally, we compile "soccer.tex" and we obtain a LaTeX output document containing a picture as shown below: