DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XYZ Plot from Excel Bug??

 
Post new topic   Reply to topic    DPlot Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
saleem145



Joined: 03 Jan 2006
Posts: 6

PostPosted: Tue Jan 03, 2006 2:35 pm    Post subject: XYZ Plot from Excel Bug?? Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Jan 03, 2006 5:16 pm    Post subject: Reply with quote

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.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saleem145



Joined: 03 Jan 2006
Posts: 6

PostPosted: Tue Jan 03, 2006 5:18 pm    Post subject: I don't think that is the issue Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Jan 03, 2006 5:43 pm    Post subject: Reply with quote

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.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saleem145



Joined: 03 Jan 2006
Posts: 6

PostPosted: Tue Jan 03, 2006 5:55 pm    Post subject: Points are being dropped Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Jan 03, 2006 6:04 pm    Post subject: Reply with quote

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.
_________________
David Hyde
support@dplot.com


Last edited by DPlotAdmin on Wed Jan 04, 2006 5:41 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saleem145



Joined: 03 Jan 2006
Posts: 6

PostPosted: Wed Jan 04, 2006 8:07 am    Post subject: XY Problem Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Wed Jan 04, 2006 11:09 am    Post subject: Reply with quote

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.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saleem145



Joined: 03 Jan 2006
Posts: 6

PostPosted: Wed Jan 04, 2006 11:25 am    Post subject: Thanks -- it works Reply with quote

Hello,

Both problems are solved. You are brilliant!!

Saleem
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Wed Jan 04, 2006 11:40 am    Post subject: Reply with quote

Well... "brilliant" is probably a bit much Smile , but thanks. Let me know if you run into any other problems.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jksmurf



Joined: 27 Sep 2005
Posts: 36

PostPosted: Mon Jan 16, 2006 12:34 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Mon Jan 16, 2006 12:01 pm    Post subject: Reply with quote

Quote:
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?

Quote:
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.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jksmurf



Joined: 27 Sep 2005
Posts: 36

PostPosted: Mon Jan 16, 2006 8:13 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Mon Jan 16, 2006 9:51 pm    Post subject: Reply with quote

Quote:
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.


Quote:
Thanks and apologies for the idiot post above...


No apologies necessary, sorry you're having difficulties.

Quote:
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.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jksmurf



Joined: 27 Sep 2005
Posts: 36

PostPosted: Mon Jan 16, 2006 10:15 pm    Post subject: Reply with quote

File Sent, thanks.

k.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Jan 17, 2006 12:06 am    Post subject: Reply with quote

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.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jksmurf



Joined: 27 Sep 2005
Posts: 36

PostPosted: Tue Jan 17, 2006 12:30 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Jan 17, 2006 2:21 pm    Post subject: Reply with quote

Quote:
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.

Quote:
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.

Quote:
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.

Quote:
There's another behaviour I cannot quite grasp ...


That's definitely a bug. Will fix it as soon as possible.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group