Page 1 of 1

3D surface plot from sparse data?

Posted: Wed May 18, 2005 1:35 pm
by detchells
DPlot looks like it *could* be just what I need, but I'm not sure of what a 3D surface plot would look like, generated from fairly sparse data. - Is there a way to have it do something like a b-spline fit in 3D to scattered data points?

The data is from a lens-testing program, it consists of 17 points distributed across a rectangular area. (You can see the arrangement of the points here: http://www.luminous-landscape.com/image ... 6-70mm.jpg

I'll need to batch-process a number of data sets like this, generating JPEGs that'll be loaded into an interactive web page.

Can DPlot do this?

Posted: Wed May 18, 2005 2:03 pm
by DPlotAdmin
Can DPlot do this?
With a little effort, yes. If I understand the data in your link correctly, here's a plot of it:

Image

The black lines show how your data is triangulated. Those triangles are considered planar, so the surface is very angular.

You can generate a new plot using an interpolation scheme similar to bspline with Options>Generate Mesh. The following plot was produced by that menu command using default values and producing a 32x32 grid of points:

Image

Much better. Or, at least, much smoother. The triangles are still considered planar, there are just lots more of them. The equivalent macro/DDE command to produce that surface is

GenerateMesh(32,32,-2,-2,2,2,0,0,4)

where all the parameters for that command are described in the Help file.

You didn't ask so pardon the unsolicited advice, but... you mentioned JPEGs - I'd really recommend PNG over JPEG for any type of graph. DPlot's forced "good" JPEG compression makes a fairly ugly picture and generally doesn't compress as well as PNG, and PNG of course has the advantage of being lossless. Here's the JPEG of the first example, 38Kb as opposed to 10Kb for the PNG:

Image

Posted: Sat May 21, 2005 2:06 pm
by detchells
DPlotAdmin wrote: With a little effort, yes. If I understand the data in your link correctly, here's a plot of it:
That's just the ticket, David, many thanks. I was having some trouble getting data into DPLot (likely not helped by running it on a Mac under Virtual PC). I installed the trial version today on my XP notebook, which also has Excel installed. The Excel add-in worked like a charm, looks like the program will do exactly what I need it to. We're still 3-4 weeks away from actually needing it, but at least now I know that I have a solution that'll work for what we need. - The macro language is an unexpected, *huge* bonus, as we're going to have literally hundreds of files to process.

Also, thanks for the PNG recommendation. DPLot's output will likely be an intermediate format, as it's likely to end up as a GIF or some such. - Mac browsers seem to have a hard time with PNG, and we've got a fair number of Mac users on our site. (Or is this no longer the case? PNG would be a plus, if it'd work for us...)

Anyway, thanks for the detailed answer (with examples no less), and congrats on a fine product!

Posted: Sat May 21, 2005 2:30 pm
by DPlotAdmin
That's just the ticket, David, many thanks. I was having some trouble getting data into DPLot (likely not helped by running it on a Mac under Virtual PC).
I have absolutely no experience with a Mac, so take this for what it's worth - I ran across this: http://appdb.winehq.org/appview.php?app ... cc36de6fc6 recently.
"DPlot seems to work without any special workarounds in Wine. I have Wine set up to identify itself as win2k, but other than that it's a stock install."
Mac browsers seem to have a hard time with PNG, and we've got a fair number of Mac users on our site. (Or is this no longer the case? PNG would be a plus, if it'd work for us...)
Searching for "PNG browser support" I came across this:
http://www.libpng.org/pub/png/pngstatus.html#browsers
"But on the other (Apple) side of the fence, Microsoft's MSIE 5 for Macintosh has near-perfect PNG support"

IE on Windows still does a lousy job with transparency, but that's mostly a non-issue for me. From the article, though, it looks like everything works well on a Mac.
Anyway, thanks for the detailed answer (with examples no less), and congrats on a fine product!
You're quite welcome, and thanks. Let me know if you have any other questions.