3D plot

Beta releases, announcements and anything else that doesn't fit below. Please read the <B>Welcome</B> topic.

Moderator: DPlotAdmin

Post Reply
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

3D plot

Post by joecar »

I know how to plot a 3D surface from a straight list of X,Y,Z values in a .csv file.

But how would I plot a 3D surface when the .csv file contains the data arranged in an M * N array with the X-values across the top,
Y-values down the left side, (possibly a table name in the upper left corner), (possibly the axis names),
and the rest of the array is all the Z-values for intersecting X and Y values (rows and columns)...?

Would I have to convert this array into a list of X,Y,Z values (i.e. list out every point in the M * N array)...?

For example, my data looks like this (see images), I want to plot it in 3D in DPlot.

Image

Image


How do I attached .csv file...?
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Without the heading, you should be able to read your CSV file into DPlot using the "Z Table" file import plugin. (Select File>Open. Select Plugins. Scroll through the list to "Z Table".)

I see you're using Quattro Pro; if by chance you also have Excel then this same sort of thing can be done with the ZGrid Add-In command.

Attachments: Can't do in the forums. You're welcome to send an attachment via e-mail.
Visualize Your Data
support@dplot.com
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Without the heading, you should be able to read your CSV file into DPlot using the "Z Table" file import plugin. (Select File>Open. Select Plugins. Scroll through the list to "Z Table".)
PS: The above isn't quite right. The Z Table plugin expects a table of Z values only, and prompts you for the X,Y extents, assuming rows and columns are evenly-spaced (which yours are).
Visualize Your Data
support@dplot.com
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

Ok, thanks, I'll give the Z Table input method a try.
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Z table

Post by joecar »

File contains this (tab separated):

10 10 10 10 10 10 10
10 10 10 10 10 10 10
10 10 10 10 10 10 10
10 10 10 10 10 10 10
10 10 10 10 10 10 10
10 10 10 10 10 10 10
10 10 10 10 10 10 10

From DPLot I open that file using Z Table, I specify X/Y min/max to be 0/0 and 60/60, I see an empty looking contour plot...

I them change the extents and I get this (see below)...

I'm not sure what I'm doing wrong...?


Image
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Since all your Z values = 10, I don't either. Either that isn't the file you opened, or something is really wrong. You're welcome to send me your file.
Visualize Your Data
support@dplot.com
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

I only have Quattro Pro.
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

DPlotAdmin wrote:Since all your Z values = 10, I don't either. Either that isn't the file you opened, or something is really wrong. You're welcome to send me your file.
File sent.
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

I reinstalled DPlot, updated to latest, and now I can't repeat the problem...

[ lol, problem must be between keyboard and seat ]

now I only see the 7x8 (instead of 7x7) problem as I said in my email.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

If you can make a goofy-looking plot from your all Z=10 file then please let me know. Or if you have some other problem with a different file then let me know about that, also, of course.
Visualize Your Data
support@dplot.com
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

Ok, and thanks for your help.
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

Hi David,

Now I have a Z table where:
for Y<2400 the Y increment is 200
for Y>2400 the Y increment is 400

i.e. the Y axis is not evenly spaced (see pic below).

How would I enter this data so I can plot it...?


Image


The .csv file contains:

Code: Select all

    ,0.08,0.12,0.16,0.20,0.24,0.28,0.32,0.36,0.40,0.44,0.48,0.52,0.56,0.60,0.64
 400,19.0,19.0,19.0,19.0,20.0,20.6,20.0,18.2,16.6,15.6,14.7,14.1,13.0,11.4,11.0
 600,22.0,22.0,22.0,22.0,22.0,23.6,22.0,21.0,18.5,17.0,16.0,15.0,13.9,11.4,11.0
 800,12.0,12.0,27.0,27.0,26.5,26.0,24.0,23.0,20.1,17.9,16.5,15.0,13.9,11.4,11.0
1000,15.0,15.0,30.0,30.0,29.0,28.0,25.6,23.5,21.6,19.0,17.0,15.0,13.9,11.4,11.0
1200,20.0,20.0,35.1,34.5,32.5,29.8,27.5,25.7,24.1,21.0,20.0,18.0,16.2,13.0,11.4
1400,25.0,25.0,36.3,35.8,33.9,31.2,29.2,27.6,26.2,24.0,23.0,20.0,18.1,14.0,12.0
1600,37.8,37.6,37.4,36.8,35.0,32.5,30.6,29.1,28.0,26.0,25.0,22.0,19.8,15.0,12.5
1800,38.7,38.5,38.3,37.7,36.0,33.5,31.7,30.4,29.5,27.8,26.8,24.0,21.3,16.0,13.8
2000,39.5,39.3,39.0,38.5,36.9,34.4,32.6,31.4,30.6,29.9,28.0,27.0,22.6,17.0,15.0
2200,40.1,40.0,39.7,39.2,37.6,35.1,33.4,32.3,31.5,30.9,29.0,28.0,23.5,17.5,16.0
2400,40.6,40.5,40.2,39.7,38.1,35.7,34.0,32.8,32.1,31.7,30.0,29.0,25.0,18.0,16.5
2800,41.4,41.2,40.9,40.4,38.9,36.4,34.7,33.6,32.9,32.5,31.0,30.0,27.3,21.0,18.0
3200,41.7,41.6,41.3,40.8,39.3,36.7,34.9,33.8,33.0,32.6,32.0,31.0,27.3,24.2,19.0
3600,41.8,41.7,41.4,40.9,39.4,36.7,34.8,33.6,32.8,32.3,32.0,31.0,27.3,24.6,22.0
4000,41.7,41.6,41.3,40.8,39.2,36.5,34.6,33.3,32.5,31.8,31.3,30.6,27.3,24.9,23.3
4400,41.5,41.3,41.0,40.5,38.9,36.2,34.3,33.0,32.2,31.4,30.5,29.3,27.5,25.1,24.4
4800,41.2,41.0,40.7,40.2,38.5,35.8,34.1,33.0,32.2,31.3,31.0,28.9,27.5,25.4,25.2
5200,40.9,40.8,40.5,39.9,38.2,35.5,34.1,33.3,32.7,31.7,31.0,29.5,27.5,26.2,25.8
5600,40.7,40.6,40.3,39.8,37.9,35.4,34.4,34.2,33.9,33.0,32.0,30.5,27.9,27.0,26.1
6000,40.7,40.5,40.1,39.3,37.9,35.4,34.5,34.2,33.9,33.0,32.0,30.5,27.9,27.0,26.1
6400,40.7,40.5,40.1,39.3,37.9,35.4,34.5,34.2,33.9,33.0,32.0,30.6,27.9,27.0,26.1
6800,40.7,40.5,40.1,39.3,37.9,35.4,34.5,34.2,33.9,33.0,32.0,30.6,27.9,27.0,26.1
7200,40.7,40.5,40.1,39.3,38.0,35.5,34.5,34.2,33.9,33.0,32.0,30.7,27.9,27.0,26.1
7600,40.7,40.5,40.1,39.3,38.0,35.5,34.5,34.2,34.0,33.0,32.0,30.7,28.0,27.1,26.1
8000,40.7,40.5,40.1,39.3,38.0,35.5,34.5,34.2,34.0,33.0,32.0,30.7,28.0,27.1,26.2
This data is ignition timing vs airmass vs rpm (in case you're wondering what it is).
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Aside from the Excel Add-In ZGrid command, your only option is to rearrange your values into X,Y,Z columns.

This is probably a good time to write another plugin module to handle this, but I cannot promise a release date.
Visualize Your Data
support@dplot.com
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

David, ok thanks...

in the meantime I'll learn how to write a spreadsheet macro to linearize the array.
joecar
Posts: 43
Joined: Thu May 11, 2006 10:33 pm
Location: So.Cal.

Post by joecar »

Oh, in my email did you see the extra data points (i.e. 7x8 instead of 7x7)...?
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Yes, and that was answered. The problem is the plugin erroneously interprets an extra blank line at the end of the file as a row of data. If you open that file with Notepad, move to the end and press <Del>, the file will be processed as expected, though now you'll get the correct error message stating that all Z values are equal and DPlot can't produce a surface plot. If you change any of those 10's to anything else you'll get a plot.
Visualize Your Data
support@dplot.com
Post Reply