11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.3 Maple Plotting Data Structures • 225Figure 6.1 How plots are displayedExamplesYou can assign the plotting data structures to variables, transform theminto other structures, save them, or print them.You can see examples of a plot structure in either two- or threedimensionsby line printing such a structure.> lprint( plot(2*x+3, x=0..5, numpoints=3, adaptive=false) );PLOT(CURVES([[0., 3.], [2.61565849999999989, 8.2313170\0000000066], [5., 13.]],COLOUR(RGB,1.0,0.,0.)),AXESLABELS("x",""),VIEW(0. .. 5.,DEFAULT))Here, plot generates a PLOT data structure that includes theinformation for a single curve defined by three points. The curve is coloredwith RGB values (1.0, 0, 0), which correspond to red. The plot has ahorizontal axis running from 0 to 5. Maple, by default, determines thescale along the vertical axes using the information that you provide inthe vertical components of the curve. The numpoints = 3 and adaptive= false settings ensure that the curve consists of only three points.The second example is the graph of z = xy over a 3 × 4 grid. ThePLOT3D structure contains a grid of z values over the rectangular region[0, 1] × [0, 2].> lprint( plot3d(x*y, x=0..1, y=0..2, grid=[3,4]) );PLOT3D(GRID(0. .. 1.,0. .. 2.,Array(1 .. 3,1 .. 4,{(2,2) = .333333333333333314, (2, 3) = .666666666666666629, (2, 4) = 1., (3, 2) = .666666666666666629, (3, 3) =1.33333333333333326, (3, 4) = 2.},datatype = float[8],storage = rectangular,order = C_order)),AXESLABELS(x,y,""))The structure includes labels x and y for the plane but no labelfor the z-axis.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!