Zedgraph Magnitude issue in X2Axis in vb.net or c#

三世轮回 提交于 2020-01-04 13:44:25

问题


I am having hard time trying to do get the excel semi log plot with zedgraph:

I currently have:

To do this I have

Dim pane As New GraphPane()
'reverse order
pane.X2Axis.IsVisible = True
pane.XAxis.IsVisible = False
pane.YAxis.Scale.IsReverse = True
pane.YAxis.Scale.IsPreventLabelOverlap = True
' log type
pane.X2Axis.Type = AxisType.Log
pane.AxisChange()
' the y axis scale
pane.YAxis.Scale.Min = -20
pane.YAxis.Scale.Max = 120
'here I tried to manipulat x axis but had no success 

'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)

As you can see, the data with x2=125,250,500,750,1 is not similar TO EXCEL Semi Log plot as zedgraph's numbers are really small Only in this part....

How to get the wanted excel graph with zedgraph? Is there a way to zoom only that part or something? Why is it appearing 10^-1, 10^0 ,10^1 ? and not 10^2, 10^3 10^4


回答1:


You need to set the axis minimum.

chart.GraphPane.YAxis.Scale.Min = 0;
chart.GraphPane.YAxis.Scale.Max = 100;

or something similar to this. Make sure you add the GraphPane part. I hope this works; again, I can't test it because I actually don't have this module installed on my current machine.

This is a pretty useful thing to get if you're using ZedGraph a lot. I was pointed at this by someone else here but I can't find their post to give them credit.



来源:https://stackoverflow.com/questions/15044886/zedgraph-magnitude-issue-in-x2axis-in-vb-net-or-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!