XYYY plot problems with number of points

Q&A for C, C++, and/or C# developers using DPlot
Post Reply
thorthebrave
Posts: 9
Joined: Mon Nov 09, 2009 5:47 pm

XYYY plot problems with number of points

Post by thorthebrave »

I have 151 y points, Line[0] has 51, Line[1] has 50 and Line[2] has 50

dp.NP[0] = 51;
dp.NP[1] = 50;
dp.NP[2] = 50;

but the 51 makes the plot flash. If I change 51 to 50, such that they are all 50

dp.NP[0] = 50;
dp.NP[1] = 50;
dp.NP[2] = 50;

then it plots, but that means that the 51 point that should have been in Line[0], is now the first point of Line[1], and etc.

Here is the rest of the code

public void XYThisplot(double[] x,double[] y)
{
dplot.DPlot_FindDPLOTLIB();

int DocNum;
int NP;
string cmds;
NP = y.Length;


dplot.DPLOT dp = new dplot.DPLOT();
dp.Initialize();
dp.Version = dplot.DPLOT_DDE_VERSION;
dp.DataFormat = dplot.DATA_XYYY;
dp.MaxCurves = 3; // Must be >= number of curves we plot
dp.MaxPoints = NP; // Anything >= NP will do
dp.NumCurves = 3;
dp.ScaleCode = dplot.SCALE_LINEARX_LINEARY;
dp.LegendX = 0.05F;
dp.LegendY = 0.05F;
dp.NP[0] = 51;
dp.NP[1] = 50;
dp.NP[2] = 50;
dp.LineType[0] = dplot.LINESTYLE_SOLID;
dp.LineType[1] = dplot.LINESTYLE_DOTTED;
dp.LineType[2] = dplot.LINESTYLE_LONGDASH;
dp.Title1 = "Pressure (psi) along the well (ft)";
dp.XAxis = "Along the wellbore (ft)";
dp.YAxis = "Pressure (psi)";


cmds = "[AutoScale()]" +
"[Caption(\"Pressure vs. Distance\")]" +
"[Legend(1,\"Blank Pipe\")][Legend(2,\"Annulus\")][Legend(3,\"Sandface\")]" +
"[DocMaximize()][ClearEditFlag()]";
DocNum = dplot.DPlot_Plot8(ref dp, ref x[0], ref y[0], cmds);

Any idea what is might be
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

You'll need to use

dp.DataFormat = dplot.DATA_XYXY;

and duplicate your X array twice (minus that 51st value).
Visualize Your Data
support@dplot.com
thorthebrave
Posts: 9
Joined: Mon Nov 09, 2009 5:47 pm

thank you

Post by thorthebrave »

That solved it, thank you so much.
Do you have any documentation for sending data through dlib,
I'd like some information on what all the different commands are, and all the different dp. properties and so on. I Have gone through you download manual, but it is not very extensive on the dlib part.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Look in the \docs folder below dplotlib.dll.
Visualize Your Data
support@dplot.com
Post Reply