"surface" plots

Hi,

I tried to get a 3D "surface" plot (comapreable to a matrix surface plot or matrixplot) of a list in the form:

[[xi,yi,zi],....]

where xi are the x-data, yi are the y-data and zi are some velocity data. Unfortunately I found only the possibility to draw a pointplot3d. Maybe anybody can help me.

Thanks

Dirk

View 6629_data2.mw on MapleNet or Download 6629_data2.mw
View file detailsDownload 6629_data2.xls
View file details

surfdata

may be what you are looking for.

PS. However, it sounds like the output of

surfdata(data2, axes = boxed);

is not the intended surface. This seems better:

PLOT3D(POLYGONS(data2),STYLE(PATCHNOGRID),AXESSTYLE(BOX),
ORIENTATION(6.,68.));


polygonplot3d

Thanks for the hint with polygonplot3d! I am still a bit displeased with the "incomplete" borders. Restructuring the basic data source did not work, but I did not want to add any data points.

incomplete borders

Observing the combination of points and polygons:

with(plots):
with(plottools):
data2:=...
p1:=pointplot3d(data2, color = red):
p2:=polygon(data2):
display([p1,p2],axes=boxed,orientation=[74,60.]);

I think that there are two problems here:
 

1. Some points are not joined by segments, making the borders ragged.

2. Some polygons are not correctly painted (probably related to a longstanding bug), paradoxically making the borders a bit less ragged.

Not what you want

I don't believe that either of these are doing what you want to be done.

surfdata considers the data to be an nx3 array of z values and plots each z values as though on an nx3 grid.

polygonplot3d considers the data to be a single polygon, with the data defining the vertices. Since the data are not ordered correctly for a polygon (and don't in fact define a single polygon) you will get a polygon that overlaps itself in many places and occupies space that it should not. It's only because the data you have are roughly in a plane that the polygon looks like anything useful at all.

David Clayworth Maplesoft GUI Developer

so,

how would you do it?

I have expected that the code generating the polygons were capable to optimize and avoid overlappings.

A useful package maybe.....

I am currently facing exactly the same problem, that is to plot a surface which is defined at arbitrary points in the xy plane.

I have written a package that takles the problem by first performing a Delaunay triangulation in the xy plane, and by then plotting the resulting triangles. You will find it attached, together with a sample worksheet including your data. I hope you will find it useful.

(please remove the initial numbers befor using them)

Please be warned that this is my first try at package writing, and that there is no documentation up to now.

Paul

View 8933_data2.mw on MapleNet or Download 8933_data2.mw
View file details

Download 8933_Surfplot.lib
View file details

Download 8933_Surfplot.ind
View file details

but only available within Maple 12

your suggestion is working well, but unfortunately the "Surfplot" Package is only available within Maple 12!

Some precision

Could you be a little more specific?

Does the attached package only work under Maple 12? If yes, I shall investigate why.

However, it would help me if you knew more precisely what instruction, routine, etc... is causing an issue.

Regards,

Paul

I work with Maple 11, which

I work with Maple 11, which does not include the Surfplot-package. I have checked this in the package library. I thik this is a new feature of Maple 12.

After executing your worksheet (8933_data2.mw), Maple 11 returns the following error message after the command "with(Surfplot)":

"Error, invalid input: with expects its 1st argument, pname, to be of type {package, module}, but received Surfplot"

Therefore following commands of your worksheet does not work in Maple 11:

  1. RemoveEquals
  2. Triangulate

Regards, Dirk

Something is wrong

Paul,

I have inspected these library files and experimented installing them, but they seem wrong. In particular, I do not see any entry in the Surfplot.ind file. Could you check whether these files work for you?

My mistake....

is it correct that you added

is it correct that you added two times the same file (.ind and no .lib)?

Uploading problem

Hello,

Apparently, this is an upload problem...

When clicking the "green arrow", I can upload the .lib file, but I end up with a link to the .ind one, whatever I do.

I shall try and understand what is happening. Meanwhile, I send you a private Email (if possible...)

Sorry, and regards

Paul

 

links

Now it works great!

<p>Thanks again!</p>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}