Menu

values seem not to match when using x2 axis log scale

putoyair
2013-02-26
2013-02-26
  • putoyair

    putoyair - 2013-02-26

    I have an semilog excel plot that I would like to do with zedgraphgraph here: http://i.stack.imgur.com/belpk.png

    then I have http://i.stack.imgur.com/9dhrv.png

    So the problem is the values do not seem to match, aka (125,0) is being displayed in a very short distance when comparing to excel graph, I do not know what I am doing wrong, could you please help me out? What is it needed to get the most similar to excel plot ?

    this is the code:

            Dim pane As New GraphPane()
            'X2 AXIS 
            pane.X2Axis.IsVisible = True
            pane.XAxis.IsVisible = False
            pane.YAxis.Scale.IsReverse = True
            pane.YAxis.Scale.IsPreventLabelOverlap = True
            ' ACTIVATE log type
            pane.X2Axis.Type = AxisType.Log
            pane.AxisChange()
            ' Y axis scale
            pane.YAxis.Scale.Min = -20
            pane.YAxis.Scale.Max = 120
    
            'the data
    
            Dim list As New PointPairList()
            Dim list2 As New PointPairList()        
            list.Add(0, 0)
            list.Add(125, 0)
            list.Add(250, 0)
            list.Add(500, 5)
            list.Add(750, 5)
            list.Add(1000, 10)
            list.Add(1500, 10)
            list.Add(2000, 5)
            list.Add(3000, 10)
            list.Add(4000, 10)
            list.Add(6000, 10)
            list.Add(8000, 20)
            list2.Add(125, 30)
            list2.Add(500, 30)
            list2.Add(750, 40)
            list2.Add(1000, 50)
            list2.Add(1500, 65)
            list2.Add(2000, 65)
            list2.Add(3000, 70)
            list2.Add(4000, 80)
            list2.Add(6000, 90)
            list2.Add(8000, 100)
            Dim myCurve As LineItem = pane.AddCurve("Series 1", list, Color.Blue, SymbolType.Diamond)
            Dim myCurve2 As LineItem = pane.AddCurve("Series 2", list2, Color.Magenta, SymbolType.Square)
    
     
    • lmat

      lmat - 2013-02-26

      Dear Mr. Yair,

      Well, first things first: I don't see the point 0, 250 anywhere on the
      second graph (I presume this is the Zedgraph output). In the first graph
      (which I am presuming is the one from Excel), the smallest X value is 100,
      the largest is 10000. In the second graph, the smallest x value is .1, the
      largest, 10. Can you account for this discrepancy?

      In Christ,
      Aaron Laws

      On Tue, Feb 26, 2013 at 3:47 AM, putoyair putoyair@users.sf.net wrote:

      I have an semilog excel plot that I would like to do with zedgraphgraph
      here: http://i.stack.imgur.com/belpk.png

      then I have http://i.stack.imgur.com/9dhrv.png

      So the problem is the values do not seem to match, aka (125,0) is being
      displayed in a very short distance when comparing to excel graph, I do not
      know what I am doing wrong, could you please help me out? What is it needed
      to get the most similar to excel plot ?

      this is the code:

          Dim pane As New GraphPane()
          'X2 AXIS         pane.X2Axis.IsVisible = True        pane.XAxis.IsVisible = False        pane.YAxis.Scale.IsReverse = True        pane.YAxis.Scale.IsPreventLabelOverlap = True        ' ACTIVATE log type
          pane.X2Axis.Type = AxisType.Log
          pane.AxisChange()
          ' Y axis scale        pane.YAxis.Scale.Min = -20        pane.YAxis.Scale.Max = 120
          'the data
      
          Dim list As New PointPairList()
          Dim list2 As New PointPairList()
          list.Add(0, 0)
          list.Add(125, 0)
          list.Add(250, 0)
          list.Add(500, 5)
          list.Add(750, 5)
          list.Add(1000, 10)
          list.Add(1500, 10)
          list.Add(2000, 5)
          list.Add(3000, 10)
          list.Add(4000, 10)
          list.Add(6000, 10)
          list.Add(8000, 20)
          list2.Add(125, 30)
          list2.Add(500, 30)
          list2.Add(750, 40)
          list2.Add(1000, 50)
          list2.Add(1500, 65)
          list2.Add(2000, 65)
          list2.Add(3000, 70)
          list2.Add(4000, 80)
          list2.Add(6000, 90)
          list2.Add(8000, 100)
          Dim myCurve As LineItem = pane.AddCurve("Series 1", list, Color.Blue, SymbolType.Diamond)
          Dim myCurve2 As LineItem = pane.AddCurve("Series 2", list2, Color.Magenta, SymbolType.Square)
      

      values seem not to match when using x2 axis log scalehttps://sourceforge.net/p/zedgraph/discussion/392231/thread/b08bc627/?limit=50#283e

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/zedgraph/discussion/392231/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/prefs/

       
  • putoyair

    putoyair - 2013-02-26

    Thanks for response:

    I don't see the point 0, 250 anywhere on the
    second graph (I presume this is the Zedgraph output).
    ---- You are correct it is zedgraph output, I forgot to include this point, also I forgot to delete the list.Add(0, 0)...

    In the first graph (which I am presuming is the one from Excel),
    - yes the fisrt graph is a excel plot

    the smallest X value is 100, the largest is 10000.
    - absolutely right, x goes like this, 100,1000,10000, the values for x2 I have are and it would be awesome to have them as x2 labels are:
    x2axis values = {125,250,500,750,1000,1500,2000,3000,4000,6000,8000}
    for y={-20,0,20,40,60,80,100,120}

    In the second graph, the smallest x value is .1, the
    largest, 10. Can you account for this discrepancy?
    - that is one problem, the smallest value for x2axis is 100, the only value that changes is y as described above, the problem here is I am using a semilog plot, but I am not getting the correct x2axis displayed values.
    Besides having the correct x2 values i would like to have according labels, do you find any missing instruction?

    I mean the points for graph 1

    (125, 0)
    (250, 0)
    (500, 5)
    (750, 5)...

    are too 'squeezed' not as in excel plot, the output of zedgraph is fine, the only issue is the points are not being log scaled... Also the first graph goes from 100 to 10000, second graph must be the same

    I hope I explained the issue.

    Thank you.

     

    Last edit: putoyair 2013-02-26

Log in to post a comment.