vb.net 或 c# 中 X2Axis 中的 Zedgraph 幅度问题 [英] Zedgraph Magnitude issue in X2Axis in vb.net or c#

查看:15
本文介绍了vb.net 或 c# 中 X2Axis 中的 Zedgraph 幅度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难用 zedgraph 得到 excel 半对数图:

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

我目前拥有:

要做到这一点,我有

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)

如您所见,x2=125,250,500,750,1 的数据与 EXCEL Semi Log plot 不相似,因为 zedgraph 的数字非常小 仅在这一部分....

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....

如何使用zedgraph获取想要的excel图表?有没有办法只缩放那部分或什么?为什么会出现 10^-1, 10^0 ,10^1 ?而不是 10^2, 10^3 10^4

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

推荐答案

您需要设置坐标轴最小值.

You need to set the axis minimum.

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

或类似的东西.确保添加 GraphPane 部分.我希望这有效;再次,我无法测试它,因为我实际上没有在我当前的机器上安装这个模块.

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.

这是如果您经常使用 ZedGraph,这是一个非常有用的东西.我在这里被其他人指出了这一点,但我找不到他们的帖子来给予他们信任.

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.

这篇关于vb.net 或 c# 中 X2Axis 中的 Zedgraph 幅度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆