gpt4 book ai didi

c# - Oxyplot:对数干图是颠倒的

转载 作者:太空宇宙 更新时间:2023-11-03 12:19:56 27 4
gpt4 key购买 nike

我想在具有对数 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 };)...然后图形就可以正确显示了!

关于c# - Oxyplot:对数干图是颠倒的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47887366/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com