mr_david

32 Reputation

2 Badges

16 years, 237 days

MaplePrimes Activity


These are answers submitted by mr_david

I did go for listcontplot, but I didn't find it too practical, because the x-y-plane is divided into unit-squares which wasn't what I wanted. So when my supervisor suggested the command PLOT3D(GRID ..., I changed to that one.

It seems that quite a few threads in this forum are going along similar lines as this one, and my question seems to be quite a common one. Nevertheless, the documentation about the command is surprisingly bad. So in case anyone should ever stumble across this thread, here are a few remarks.

A starting point is to use maple help (but don't type plot3d! Capitals are essential. PLOT3D gives what you're looking for).

A somewhat more illuminating treatment (even with a useful example..) is given in the "Maple 9 Advanced Programming Guide" (google that!), on page 264. (I'm using Maple 12, it still works)

This example can be quite confusing at first, because they don't say too much about how the details work. I'll give it a try: Consider the command PLOT3D(GRID(-2..1, -4..4, A)), where A  has been defined as a list of lists, i.e. for example A:=[[1,2,3,4],[5,6,7,8],[9,10,11,12]]. This command first establishes a rectangle in the x-y plane, with x going from -2 to 1 and y going from -4 to 4. This rectangle is now divided into smaller sub-rectangles, according to the specifications in A: The number of lists within the list (here 3) tells us the number of equally spaced vertical lines (in the y-direction), including the two boundaries of the rectangle (i.e. with our A, we would have to put 3-2=1 additional lines in the vertical direction). The number of numbers within the lists (here 4) tells us the number of equally spaced horizontal lines. So now we have a rectangular coordinate grid.

The actual numbers within the lists now give the z-values above the x,y-points. 1 goes to the bottom left corner of the rectangle, i.e. is the z-value above x=-2, y=-4. Then, 2 belongs to the next point on the left boundary of the rectangle, etc.

I hope that helps anyone that comes across the same problem. Oh, by the way, The way to get a contour plot is to use STYLE(CONTOUR).

Thank you. I had found that thread as well though. But I haven't managed to make it work. I'll give it another go tomorrow and post whether I succeeded or not.

cheers,

David

Page 1 of 1