Using EditAddToX, EditAddToY

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
arthur_etchells
Posts: 30
Joined: Fri Jul 15, 2005 9:18 am

Using EditAddToX, EditAddToY

Post by arthur_etchells »

Hey, just wanted to thank you again for your time. I came up with a workaround for the issue I was having with using dynamic & static extents on the same plot. I realized I could enable dynamic scaling for the whole graph, and use an invisible line to force dplot to always scale one axis to the desired extents. So, if I want to keep the x axis dynamic, but fix the y axis extents at y = 0 and y = 1.5, I make a line with the values (4, 0) to (4, 1.5), where 4 is an x value already included in the plot.
Now for the issue...
Adding the dummy line by hand with the Edit data menu command works perfectly, so I figured the EditAddToX and EditAddToX commands would be my solution. Using SelectCurve to create the new curve works fine, but the edit commands seem to be ignored by DPlot. My version is 1.9.9.9
Any ideas?
Much thanks,
Arthur
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Arthur,
I'm not real clear on what you're trying to do but I think you might misunderstand what EditAddToX and EditAddToY do. Those commands add a constant to all X or Y values for the selected curve. If you knew that and that is what you intended, you also need to make sure that the SelectCurve command is passed in the same call to DPlot_Command, as in

DPlot_Command(DocNum,"[SelectCurve(2)][EditAddToX(3)]");

If instead you do this:

DPlot_Command(DocNum,"[SelectCurve(2)]");
DPlot_Command(DocNum,"[EditAddToX(3)]");

you won't get the expected results. The EditAddToX command would in this case operate on curve 1 rather than curve 2.
Visualize Your Data
support@dplot.com
arthur_etchells
Posts: 30
Joined: Fri Jul 15, 2005 9:18 am

Post by arthur_etchells »

Sorry, didn't realize that editaddtox performs an addition operation. It looks like [XY(xval, yval)] is the way to go, but DPlot seems to not like the command. I successfully added the points to the arrays graphed, but is there any way to add data values once the plot has already been made? ie, arrays have been entered, etc.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Yes. XY will do it, but as before you need to be sure you're adding data to the correct curve (by combining SelectCurve and XY in the same call).

The btest3 and ctest3 example programs use XY to add data points 10 times per second.
Visualize Your Data
support@dplot.com
Post Reply