XYZ Plot from Excel Bug??

Found a bug? Tell us about it here
Post Reply
saleem145
Posts: 6
Joined: Tue Jan 03, 2006 2:26 pm

XYZ Plot from Excel Bug??

Post by saleem145 »

Hi,

I am trying to generate a 3d plot from excel. I am sending the following commands over the DDE Channel.

1. [FileNew(3)]
2. [FileArrays(1,90)]
3. [XYZ(1,1,1,0)]
4. [XYZ(1,1,2,0)]
5. [XYZ(1,1,3,0)]
6. [XYZ(1,2,1,0)]

After a few XYZ commands the DPLOT window closes and then nothing is plotted, any ideas??

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

Post by DPlotAdmin »

I haven't found the cause of the crash yet, but it is most likely due to all of your Z values being equal - in this case 0. You can't produce a contour plot if there is no change in Z.
Visualize Your Data
support@dplot.com
saleem145
Posts: 6
Joined: Tue Jan 03, 2006 2:26 pm

I don't think that is the issue

Post by saleem145 »

I did not post all the data but there are data points with non zero values. I have also emailed support@dplot.com an excel worksheet which shows how to replicate both the problems.

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

Post by DPlotAdmin »

I've received your spreadsheet and am working on the problem. I'll post something here as soon as I have an answer.

With your XY plot, though, I'm not getting the same results you are: all data is plotted in every case. Next time you try this please select Info>Number of Points and compare the value shown to what you expect. If the number of points IS the number expected, click the Edit Data button and check to see whether the data values are correct. If they are, select Options>Extents/Tick Marks/Size and make sure that "Specify extents" is unchecked. If it was checked, then it is likely you're using a default settings file (default.set in c:\Documents and Settings\<username>\Application Data\DPlot\Preferences) that specifies extents to use. If that's the case then deleting default.set will solve the problem. If none of the above helps, what version of DPlot are you using? Check Help>About.

I don't want to give the impression that I'm not interested in solving this problem (I am), but I'm curious about why you're not simply using the Add-In. Two functions in the Add-In (XYXY and XYZSurface) do exactly what you're trying to do.
Visualize Your Data
support@dplot.com
saleem145
Posts: 6
Joined: Tue Jan 03, 2006 2:26 pm

Points are being dropped

Post by saleem145 »

Hello,

I did the XY plot again.

1. X axis varied from 0 to 12.
2. Info -> Number of Points gave me 13.
3. Edit -> Edit data shows the first 13 points correctly. There are no more points.
4. Options -> Extents -- specify extents is unchecked.
5. Dplot version number is 2.0.2.3

You might notice that the example is just modified from the example supplied on your site. I am open to using a different methodoly. Where are routines you mention documented. What parameters do they take as input??

I am a DDE newbie -- but perhaps the problem is related to timeouts or max size of commands that can be transmitted using DDE??

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

Post by DPlotAdmin »

The Add-In was offered as an installation option when you installed DPlot (or DPlot Jr). If you installed it then you should see a "DPlot" menu in Excel. If you don't, first select Tools>AddIns. If you see "DPlot Interface", check that box then click OK. If you DON'T see a "DPlot Interface" checkbox when selecting Tools>AddIns then you most likely did not install the Add-In. If you still have the setup program for DPlot, run it again and be sure to select the Add-In.

The Add-In functions aren't especially well documented, but you might find the examples.xls spreadsheet (in the DPlot folder if/when you elect to install the Add-In) helpful. If you find the functions in the Add-In lacking you're of course welcome to make suggestions, or you can create your own solutions using functions in DPLOTLIB.DLL (included with the Add-In). Documentation for DPLOTLIB.DLL is found at http://www.dplot.com/lib/index.htm

None of the above has anything to do with the problem you're having with the XYZ command, though. There's definitely something strange going on there and I'll continue to work on that.
Last edited by DPlotAdmin on Wed Jan 04, 2006 5:41 pm, edited 1 time in total.
Visualize Your Data
support@dplot.com
saleem145
Posts: 6
Joined: Tue Jan 03, 2006 2:26 pm

XY Problem

Post by saleem145 »

Hello,

Just an idea -- if you increase the number of XY points by a factor of 10, you might be able to replicate my first problem.

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

Post by DPlotAdmin »

Saleem,
With your DPlot2d function I added several hundred points and still get the number of points expected. One thing I did notice with a large number of points, however, is quite a lot of screen flashing in DPlot. That's because the plot is regenerated after every single [XY()] command. In the case of this plot that is not necessary, and I suspect is the reason why you're having trouble. Most likely the overhead associated with redrawing the plot is causing a synchronization problem with subsequent [XY()] commands. You can get around this problem by delaying the plot being redrawn until you've sent all [XY()] commands, as in:

DDEExecute Channel, "[PostponeRedraw()]"
'
' loop through [XY()] commands
'
DDEExecute Channel, "[ViewRedraw()]"

There is a similar but much worse problem with 3D data. DPlot is attempting to generate a mesh of triangles from your input and then draw a surface plot after every [XYZ()] command. There's something nasty going on (I suspect in the triangulation) that is causing DPlot to crash when flooding it with individual [XYZ()] commands. I still need to track down what is causing the crash, but the solution at your end is similar to the problem with [XY()]: postpone generating a mesh/drawing a plot until all points are sent. You can do this by replacing all [XYZ()] commands with [XYZEx(0,1,<x,y,z>)] and finishing up with [XYZRegen()].

Please let me know if you have any questions.
Visualize Your Data
support@dplot.com
saleem145
Posts: 6
Joined: Tue Jan 03, 2006 2:26 pm

Thanks -- it works

Post by saleem145 »

Hello,

Both problems are solved. You are brilliant!!

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

Post by DPlotAdmin »

Well... "brilliant" is probably a bit much :) , but thanks. Let me know if you run into any other problems.
Visualize Your Data
support@dplot.com
jksmurf
Posts: 36
Joined: Tue Sep 27, 2005 10:37 pm

Post by jksmurf »

Hiya,

I have just tried this (using just x,y, z in 3 Excel Columns) and got a similar problem with jumping out and no plot generated.

The other thing that is a a bit wierd is the contour plot scale it (automatically) chooses seems to be way way too big and not commensurate with the Z ranges chgose for the extents.

I "think" it does this after I choose Generate Mesh, which then chooses the defaults preferences again (is there a reason why it doesn't use the extents I just defined for the XY (non-3D) contour plot?

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

Post by DPlotAdmin »

I have just tried this (using just x,y, z in 3 Excel Columns) and got a similar problem with jumping out and no plot generated.
Tried what? A series of XYZ commands in a macro you've written? One of the Add-In functions, or what?
The other thing that is a a bit wierd is the contour plot scale it (automatically) chooses seems to be way way too big and not commensurate with the Z ranges chgose for the extents.
If you're sending one point at a time using XYZ, then DPlot is forcing scale factors of 1:1:1 when the first point is received. (It can't do any better than that since there are X, Y, or Z extents to compare when there's only one point). You can override the scale factors with a [ContourScales(...)] command. If this (a series of XYZ commands) isn't what you're doing, please give a better description of what's going on.
Visualize Your Data
support@dplot.com
jksmurf
Posts: 36
Joined: Tue Sep 27, 2005 10:37 pm

Post by jksmurf »

D,

Sorry about that, a case of way too little information, my apologies. I think the first error is my fault, I forgot I had set the default profile to a Tripartite Plot Layout

What I tried was this:
-I have an Excel spreadsheet with 3 columns x,y,z with column labels and 220 rows of data.
-I selected the data and labels and chose xyzsurface from the Dplot Add-in Menu.
- It came up with a DPLOT screen with nothing on it, due to the incorrect x, y extents left over from the default.set profile.
-When I chose contour options or generate mesh it simply jumped out of DPLOT and back to the Spreadsheet. That's what happened.

When I realised the .set profile was incorrect I deleted it and (hopefully) it has regenerated a default.
-It now works to prduce a Contour Plot and when I right click to choose contour options it shows the correct Z extents in the Lower Upper Input Boxes
-It also shows the correct (presumably auto-generated) extents in the extents boxes (greyed out)
-However when I select generate mesh it jumps to a massively inflated z range. This is the bit I don't understand.

-I have one small other problem that it does not appear to savce the scaling factors for x y z when I choose save preferences to a profile.

I can send you the Excel Data file and a jpg image of what I get, if it would help at all?

Thanks and apologies for the idiot post above, I was getting a bit frustrated, but it's no excuse.

k.
p.s. Is there a default.set anywhere on the site I can download, I think I overwrote my original. I know I can regen it by re-installing, but prefer not to do that.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I can send you the Excel Data file and a jpg image of what I get, if it would help at all?
Yes, that would be very helpful, thanks.

Thanks and apologies for the idiot post above...
No apologies necessary, sorry you're having difficulties.
p.s. Is there a default.set anywhere on the site I can download, I think I overwrote my original. I know I can regen it by re-installing, but prefer not to do that.
There is no... umm... default default.set. You can delete that file to use hard-coded default values. It is located in c:\Documents and Settings\<username>\Application Data\DPlot\Preferences.
Visualize Your Data
support@dplot.com
jksmurf
Posts: 36
Joined: Tue Sep 27, 2005 10:37 pm

Post by jksmurf »

File Sent, thanks.

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

Post by DPlotAdmin »

I got your file, thanks.

My guess is when using "Generate Mesh" you have "Bivariate" checked under "Interpolation Method". That works well for smooth surfaces but not well at all for rough surfaces or sparse data. You'll find that it does very poorly within large triangles (again, sparse data). If you use "Planar" rather than "Bivariate" you'll get a much more reasonable plot. It won't smooth the surface at all, which is the advantage of "Bivariate", but it also won't produce nonsense.
Visualize Your Data
support@dplot.com
jksmurf
Posts: 36
Joined: Tue Sep 27, 2005 10:37 pm

Post by jksmurf »

Yeah that works better thanks, provided that I do not play with the Intervals again after the first generation. (Sure was bad with the sparse data, the extents were -100 to + 10 times the actual values).

Just FYI for future ref., I also observed it jumped out of DPLOT when I played around with the control points (say 20, rather than the default 4) and the XY Intervals (e.g. 100 rather than 32).

The max and min on Z are both slightly less than the real max and min, but I presume this is just the interpolation.

Any idea on why the preferences for scaling are not saved to .set file? They are also not saved when I change one of the X, Y or Z extents, is this by design due to recalc of axes?

There's another behaviour I cannot quite grasp ... If I play with the Intervals again after the first generation i.e. if I change the Intervals (even with Planar Interp) it changes the Z-Scale max and mins again to some SMALL (-5 E35 values. Even if I try and change these back in either (i.e. BOTH) Contour Options and Extents it keeps these very small values on the Z-Scale?

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

Post by DPlotAdmin »

Just FYI for future ref., I also observed it jumped out of DPLOT when I played around with the control points (say 20, rather than the default 4) and the XY Intervals (e.g. 100 rather than 32).
Thanks for the notice. I haven't had time to dive into this but will look at it as soon as possible.
The max and min on Z are both slightly less than the real max and min, but I presume this is just the interpolation.
Yes. Depending on where the actual min and max values lie and the extents of the mesh you produce, the actual min and max values may be left out. Or if you extrapolate outside the actual extents of your data, you might get a new min less than the actual min or max greater than the actual max. If you turn on the triangle borders and compare one plot to another it should be more evident what is happening.
Any idea on why the preferences for scaling are not saved to .set file?
That's by design. It is arguable whether it is a good design or not. Scale factors are one of those things that only make sense for a particular data set (or data sets with roughly the same extents) and if inappropriate scale factors are read from a preferences file you might end up with a pencil thin 3D plot and wonder what in the world the program was thinking. Sooner or later I need to revamp the preference files, allowing you to pick and choose what is and is not saved.
There's another behaviour I cannot quite grasp ...
That's definitely a bug. Will fix it as soon as possible.
Visualize Your Data
support@dplot.com
Post Reply