This is a sample of the VB.Net code we use to populate a probability graph. You will not be able to use this code directly because it refers to code not included here, but studying this will help understanding of the probability scale. The lX array is populated with percent values designed to spread evenly across the graph using the DeLinearize function. the lY value is set to the percentile value of the data set corresponding to the lX percent. If this does not make sense the first time you read it, I am not surprised. Hopefully if you really have need for a probability axis, you will have a better understanding of what is going on.
Private pNumProbabilityPoints As Integer = 200
Private Sub AddToProbabilityGraph(PaneMain As ZedGraph.GraphPane, aTimeseries As atcTimeseries)
Dim lCurve As LineItem = Nothing
Dim lX(pNumProbabilityPoints) As Double
Dim lLastIndex As Integer = lX.GetUpperBound(0)
With Pane.XAxis
If .Type <> AxisType.Probability Then
'.Type = AxisType.Linear 'for debugging
.Type = AxisType.Probability
With .MajorTic
.IsInside = True
.IsCrossInside = True
.IsOutside = False
.IsCrossOutside = False
End With
Dim lGraphics As Graphics = Me.CreateGraphics()
pMaster.AxisChange(lGraphics)
lGraphics.Dispose()
End If
For lXindex As Integer = 0 To lLastIndex
lX(lXindex) = 100 * .Scale.DeLinearize(lXindex / CDbl(lLastIndex))
Next
End With
Dim lProbScale As ZedGraph.ProbabilityScale = Pane.XAxis.Scale
Dim lAttributeName As String
Dim lIndex As Integer
Dim lXFracExceed() As Double
Dim lY() As Double
ReDim lY(lLastIndex)
ReDim lXFracExceed(lLastIndex)
For lIndex = 0 To lLastIndex
lXFracExceed(lIndex) = (100 - lX(lIndex)) / 100
lAttributeName = "%" & Format(lX(lIndex), "00.####")
lY(lIndex) = aTimeseries.Attributes.GetValue(lAttributeName)
'Logger.Dbg(lAttributeName & " = " & lY(lIndex) & _
' " : " & lX(lIndex) & _
' " : " & lXFracExceed(lIndex))
Next
With Pane.XAxis
.Scale.Min = lXFracExceed(0)
.Scale.Max = lXFracExceed(lLastIndex)
.Scale.BaseTic = lXFracExceed(0)
.Title.Text = "Percent chance exceeded"
End With
With Pane.YAxis
.Type = AxisType.Log
.Scale.IsUseTenPower = False
End With
'Upper right corner of chart is better for this graph type
Pane.Legend.Location = New Location(0.95, 0.05, CoordType.ChartFraction, AlignH.Right, AlignV.Top)
lCurve = Pane.AddCurve("CurveLabel", lXFracExceed, lY, Color.Blue, SymbolType.None)
lCurve.Line.Width = 1
lCurve.Line.StepType = StepType.NonStep
Me.Refresh()
End Sub