Oxyplot:对数干图是颠倒的
Oxyplot: logarithmic stem plot is upside down
我想在具有对数 y 尺度的柱状图中可视化 1024 个值。使用线性标度它工作正常,但是使用对数标度图形看起来很奇怪。我的代码或 oxyplot 中是否存在错误?
我的主干图是这样的:
reversed stem plot
这是我的源代码:
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));
OxyPlot 的 github 页面上有一个关于此的未解决问题。根据用户的建议(请参阅 here),临时修复可能是将系列的 Base
值设置为 1 (var series = new StemSeries { Base = 1d };
)...然后图表会正确显示!
我想在具有对数 y 尺度的柱状图中可视化 1024 个值。使用线性标度它工作正常,但是使用对数标度图形看起来很奇怪。我的代码或 oxyplot 中是否存在错误?
我的主干图是这样的: reversed stem plot
这是我的源代码:
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));
OxyPlot 的 github 页面上有一个关于此的未解决问题。根据用户的建议(请参阅 here),临时修复可能是将系列的 Base
值设置为 1 (var series = new StemSeries { Base = 1d };
)...然后图表会正确显示!