2

我想用对数 y 尺度在一个茎图中可视化 1024 个值。使用线性比例它可以正常工作,但使用对数比例,图形看起来很奇怪。我的代码或 oxyplot 中是否有错误?

我的茎图看起来像这样: 反向茎图

这是我的源代码:

        var plotModel = new PlotModel { Title = "Stem Plot" };           
        plotModel.Axes.Clear();
        if (yScalingType==(int)YScalingType.log)
        {                
            LogarithmicAxis axisY = new LogarithmicAxis               
            {
                Position = AxisPosition.Left,
                MajorStep = 20,
                UseSuperExponentialFormat = false,
                Base = 10
            };
            axisY.AbsoluteMaximum = 1000;
            axisY.AbsoluteMinimum = 0;
            plotModel.Axes.Add(axisY); 
        }
        var series = new StemSeries();
        plotModel.Series.Add(series);
        for (int i = 0; i < 1024; i++)
            series.Points.Add(new DataPoint(i, 100.0));
4

1 回答 1

1

在 OxyPlot 的 github 页面上有一个未解决的问题。根据用户的建议(请参见此处),临时修复可能是将Base您的系列的值设置为 1(var series = new StemSeries { Base = 1d };)...然后正确显示图表!

于 2017-12-19T19:01:37.487 回答