Hi
I'm trying to code in C++ and I which to generate a 3D plot of none grid data ie x,y,z values.
I'm using Dev C++ (gcc / Wming complier).
On my installation of DPlot Jr /Dplot reg version. I am having data transfer problems with the C examples.
I get a blank Dplot window generated with all the examples except
CTEST3 and FTEST which do work.
The key difference is CTEST3 uses dplot_Command()
while the other examples use DPlot_Plot(&DPlot,x,y, cmds)
So using the command:..
for loop
ret = dplot_Command(DocNum, "[XY(1,2)]");
next itr
ret = dplot_Command(DocNum, "[XY(2,3)]");
etc..
I can sucessfully plot 2D points.
However when I try
ret = dplot_Command(DocNum, "[XYZ(1, 1,2,3)]");
or
ret = dplot_Command(DocNum, "[XYZ( 1.0,2.0,3.0)]");
I get a pop up box XYZ command : Wrong data type
then
Error processing this command.
Therefore my questions are:
Is there a way I can get the examples working?
What is the correct syntax for operation of the XYZ, XYZEx .. commands?
Thanks
Matt
Problems with DPlot Jr & 3D data/ Help needed
-
- Posts: 2
- Joined: Thu Mar 29, 2007 1:16 pm
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Matt,
The "Wrong data type" message indicates (though it doesn't do it very well) that you need to set the data type for DocNum to 3D data. The easiest way to do that is when first creating that document, with [FileNew(3)].
I'm curious about why the examples wouldn't work with gcc. The last time I looked they worked just fine. I've no time at the moment but will look into this as soon as possible.
The "Wrong data type" message indicates (though it doesn't do it very well) that you need to set the data type for DocNum to 3D data. The easiest way to do that is when first creating that document, with [FileNew(3)].
I'm curious about why the examples wouldn't work with gcc. The last time I looked they worked just fine. I've no time at the moment but will look into this as soon as possible.
Your first example is correct for XYZ. Click "Search for Help on" in DPlot and on the Index tab type "XYZ" or "XYZEx".What is the correct syntax for operation of the XYZ, XYZEx .. commands?
Visualize Your Data
support@dplot.com
support@dplot.com
-
- Posts: 2
- Joined: Thu Mar 29, 2007 1:16 pm
The saga continues
Thanks for the hint dave.
However, I have now run into another problem.
In my C++ routine I'm first generating a 2D plot followed by a 3D plot.
For the 2D plot the following commands are used:
DocNum=dplot_Command(0, "[FileNew()]");
ret=dPlot_Command(DocNum, "[Title1(\"Title\")]");
the data is then entered in a loop construct:
using
sprintf (command,"[XYXY(1,%g,%g)]", *px, *py);
ret=dPlot_Command(DocNum, command);
command couts as [XYXY(1,2,3)]
This plots an updating 2D graph.
Then the routine would call:
DocNum2=dplot_Command(0,"[FileNew(3)]");
(this creates a new plot2
DocNum2 is assigned as 2)
I can then add data
ret=dplot_Command(DocNum2,"[XYZEx(0,1, 2,4,5]");
however if I do somthing like
ret=dplot_Command(DocNum2,"[XYZRegen()]");
or
ret=dplot_Command(DocNum2, "[Title1(\"Title\")]");
Dplot crashes and reopens on the next command with error processing command "[Activate(2)]"
I'm able to plot each graph in isolation, but would been mutliple windows of the 2D and 3D graphs..
N.b. I just tried plotting 2 secessive 3D plots and this works.
Is this a bug with Dplot, or is there a way to plot a 2D graph and 3D graph.
Thanks
Matt
However, I have now run into another problem.
In my C++ routine I'm first generating a 2D plot followed by a 3D plot.
For the 2D plot the following commands are used:
DocNum=dplot_Command(0, "[FileNew()]");
ret=dPlot_Command(DocNum, "[Title1(\"Title\")]");
the data is then entered in a loop construct:
using
sprintf (command,"[XYXY(1,%g,%g)]", *px, *py);
ret=dPlot_Command(DocNum, command);
command couts as [XYXY(1,2,3)]
This plots an updating 2D graph.
Then the routine would call:
DocNum2=dplot_Command(0,"[FileNew(3)]");
(this creates a new plot2
DocNum2 is assigned as 2)
I can then add data
ret=dplot_Command(DocNum2,"[XYZEx(0,1, 2,4,5]");
however if I do somthing like
ret=dplot_Command(DocNum2,"[XYZRegen()]");
or
ret=dplot_Command(DocNum2, "[Title1(\"Title\")]");
Dplot crashes and reopens on the next command with error processing command "[Activate(2)]"
I'm able to plot each graph in isolation, but would been mutliple windows of the 2D and 3D graphs..
N.b. I just tried plotting 2 secessive 3D plots and this works.
Is this a bug with Dplot, or is there a way to plot a 2D graph and 3D graph.
Thanks
Matt
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Apparently, though it isn't one I've seen before. I'll look into this as soon as possible, but it will likely be the end of the weekend before I have a fix available.Is this a bug with Dplot...
Visualize Your Data
support@dplot.com
support@dplot.com