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 

VB.net boxplot DATA_1D

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



Joined: 08 Dec 2014
Posts: 4

PostPosted: Tue Feb 12, 2019 12:05 pm    Post subject: VB.net boxplot DATA_1D Reply with quote

Greetings: Sorry for a mistaken post to the excel subject


I'm trying to build a boxplot DATA_1D in vb.net. DPlot (not my own program) crashes on me. I've looked through the programmers guide, example projects and forums and I've not found a boxplot example. Here is the snippet of the code I'm sending.


Try

dMyPlot.Initialize()
dMyPlot.Version = DPLOT_DDE_VERSION
dMyPlot.DataFormat = DATA_1D
dMyPlot.ScaleCode = 1 ' Start with linear linear
dMyPlot.MaxCurves = intCountDataSets
dMyPlot.MaxPoints = intTotalDataCount
dMyPlot.NumCurves = intCountDataSets

For intI As Integer = 0 To intCountDataSets - 1
dMyPlot.NP(intI) = intDataCount(intI)
dMyPlot.LineType(intI) = LINESTYLE_NONE
Next

intDocNum = DPlot_Plot8(dMyPlot, dX(0), dY(0), strPlotCommands)


bDplotPlotExists = True

Catch ex As Exception
bDplotPlotExists = False
End Try
End If

Here is the string of commands I'm sending with strPlotCommands

[TickMarks(1,80,40)][LogTicks(0)][ManualScale(0,1E-06,4,1)][Scale(2)][XAxisLabel("Analysis Results")][YAxisLabel("Dilution factor (the ratio of runoff to downstream stormflow), unitless")][TextFont(1,8,400,0,0,0,0,"Univers 57 Condensed")][TextFont(2,6,400,0,0,0,0,"Univers 57 Condensed")][TextFont(3,6,400,0,0,0,0,"Univers 57 Condensed")][TextFont(4,8,400,0,0,0,0,"Univers 57 Condensed")][TextFont(5,8,400,0,0,0,0,"Univers 57 Condensed")][TextFont(6,6,700,0,0,0,0,"Univers 57 Condensed")][TextFont(7,9,400,0,0,0,0,"Univers 57 Condensed")][LineWidth(0,6.9444)][LineWidth(-1,6.9444)][LineWidth(-2,6.9444)][TickMarks(1,80,40)][Legend(0,"Explanation")][Legend(1,"Highway Example Analysis (I-81)")][Legend(2,"Highway Example Analysis (I-81) Metric")][Legend(3,"Highway Example Analysis (I-81) Metric2")][LegendShow(1)][LegendParams(,,1,1,0.98,0.02,1,2,-1)][GridLines(2)][ShowCaption(0)][Size(0,6.5,6.5)][AppMinimize()]

Any help would be appreciated.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


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

PostPosted: Tue Feb 12, 2019 4:24 pm    Post subject: Reply with quote

Unless I miss something, you have not assigned the data values. So DPlot is getting a lot of undefined numbers (probably but not necessarily 0's). If that is the problem then there is likely an untrapped divide by 0 error in DPlot where it attempts to scale everything.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GregoryG



Joined: 08 Dec 2014
Posts: 4

PostPosted: Wed Feb 27, 2019 8:15 am    Post subject: Reply with quote

Hi Dave:
I'm defining the data to be graphed graph elsewhere and calling the code I showed as such

Public Sub New(ByVal bBoxPlot As Boolean, ByVal intCountDataSets As Integer, ByVal intTotalDataCount As Integer,
ByVal bCaption As Boolean, ByVal strCaption As String,
ByVal intMyAxisType As Integer,
ByVal intDataCount() As Integer, ByVal strExplanationText() As String,
ByVal dX() As Double, ByVal dY() As Double, strPlotCommands As String)

For the scatter plot I get errors like "cannot graph zeroes on log scale" or "probability needs to be between 0 and 100" from DPLot if I use anything except 0 in

intDocNum = DPlot_Plot8(dMyPlot, dX(0), dY(0), strPlotCommands)

I tried the number of datasets, the number of datasets minus one (for a zero based array), the total data count and the total data count minus one.

within my program in vb.net I can just pass dX, and dY and it knows they are arrays, if I try this with the DPLOT_Plot8 call to GLOBAL.VB, then I get an error message in the Visual Studio coding window "value of type Double() cannot be converted to double". dX(0), d(Y) seems to be telling DPlot_Plot8 that dX and dY are one-dimensional arrays.

When I tried boxplot with the above option, I got
"Unhandled exception at 0x0069FD79 in DPLOT.EXE: 0xC000041D: An unhandled exception was encountered during a user callback"

I got this from DPlot code when visual studio offered a debug option for dplot.exe (don't worry the source did not show just the error).

If I'm doing a 1D plot (boxplot), then in the command
DPlot_Plot8(dMyPlot, dX(0), dY(0), strPlotCommands) is it using dX or dY as the variable to plot. Does it ignore dX or is dX supposed to be a group number (for example if I have 5 data sets is dx supposed to be 1,2,3,4, & 5 because that is what is on the X axis--5 sets of values? For the scatter, the dX values are the array of probabilities for each dataset.


I tried to change the function call in Global VB DPlot_Plot8 so it is x() and y(), which fixed the programming interface error, but broke the code when I tried to run the program and call DPlot_Plot8.

I also tried turning off Option Strict & Option Explicit to no avail

Thanks

Greg
PS the "Notify me when a reply is posted" did not work for me I did not get an email and I checked the SPAM so it did not go there
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


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

PostPosted: Thu Feb 28, 2019 12:49 pm    Post subject: Reply with quote

Quote:
If I'm doing a 1D plot (boxplot), then in the command
DPlot_Plot8(dMyPlot, dX(0), dY(0), strPlotCommands) is it using dX or dY as the variable to plot. Does it ignore dX...


Yes. See http://www.dplot.com/lib/index.htm?dplot_plot.htm
_________________
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