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 

How to update an existing plot?

 
Post new topic   Reply to topic    DPlot Forum Index -> Basic
View previous topic :: View next topic  
Author Message
david.sarraf



Joined: 30 Sep 2008
Posts: 3

PostPosted: Tue Sep 30, 2008 2:57 pm    Post subject: How to update an existing plot? Reply with quote

I need to update a plot periodically using FreeBasic and DPLOT JR. I am using the example FreeBasic code to make the x-y plot. Each time I make the call it creates a new plot, rather than updating the old plot. I have spent some time with the documentation; the closest I can get is erasing the old data then replotting. That gives me two additional plots; one blank, and one with the new data.

How do I get rid of the first plot, or simply modify that one, rather than creating a whole new plot each time I make the system call?
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


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

PostPosted: Tue Sep 30, 2008 4:42 pm    Post subject: Reply with quote

David,

Quote:
I have spent some time with the documentation; the closest I can get is erasing the old data then replotting. That gives me two additional plots; one blank, and one with the new data.


This should not be, if you erased the curve before plotting your new data. Either this:

DPlot_Command(docnum,"[SelectCurve(1)][EditErase()]")
DPlot_Command(docnum,"[XYXY(...)]") ' or whatever you're doing to send the data

or this:
DPlot_Command(docnum,"[EditEraseData(1)]")
DPlot_Command(docnum,"[XYXY(...)]")

should do what you want. If not, please copy the relevant part of your code and send it to me - or paste it here if you like.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
david.sarraf



Joined: 30 Sep 2008
Posts: 3

PostPosted: Wed Oct 01, 2008 3:04 pm    Post subject: Success Reply with quote

Thanks for the help. I am now able to generate a plot and update the data at will. One other bump I had to overcome was selection of the plot to be updated. If the Select and Update commands were issued separately all data went to the first curve. If the commands were concatentated in the same command the data went to the intended curve. In short, curve selection did not appear to be "sticky". This was not a big problem, and it had the side benefit of making me more familiar with the command set.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


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

PostPosted: Wed Oct 01, 2008 4:17 pm    Post subject: Reply with quote

David,
That's spelled out in the documentation but I probably need to make it more clear somehow . Each call to DPlot_Command (or any other DPLOTLIB function) results in a new DDE transaction. For each new transaction, DPlot initializes several variables, including but not limited to the currently-selected curve. So this:

DPlot_Command(docnum,"[SelectCurve(3)][EditErase()]")

will delete the third curve, but this:

DPlotCommand(docnum,"[SelectCurve(3)]")
DPlotCommand(docnum,"[EditErase()]")

will delete the first (default) curve.

In any case, glad you got things working. Let me know if you have any other problems.
_________________
Visualize Your Data
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 -> Basic 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