Ticks: `EvenlySpacedMinorTickGenerator` unexpected behavior
muveer opened this issue · 0 comments
muveer commented
Unable to print major and minor ticks and Legend not able to set bubble shape
ScottPlot Version: ScottPlot 5.1
LegendItem[] items = { new()
{
LineColor = Colors.Gray,
MarkerFillColor = Colors.Gray,
MarkerLineColor = Colors.Gray,
LineWidth = 2,
LabelText = "AOP",
MarkerShape= MarkerShape.OpenCircle,
},
new()
{
LineColor = Colors.DarkRed,
MarkerFillColor = Colors.DarkRed,
MarkerLineColor = Colors.DarkRed,
LineWidth = 2,
LabelText = "Actual",
MarkerShape= MarkerShape.FilledDiamond
}};
plt.ShowLegend(items, Alignment.UpperRight);
//comment : add a scatter plot to the aop & actual
plt.Add.Scatter(xTicksPositions, aop, Color.FromColor(System.Drawing.Color.Gray));
plt.Add.Scatter(xTicksPositions, actual, Color.FromColor(System.Drawing.Color.DarkRed));
// comment : create a custom tick generator for the X axis
ScottPlot.TickGenerators.NumericManual xAxisTickGen = new(xTicksPositions, xTicksLabels);
plt.Axes.Bottom.TickGenerator = xAxisTickGen;
// comment : create a minor tick generator with 10 minor ticks per major tick
ScottPlot.TickGenerators.EvenlySpacedMinorTickGenerator minorYAxisTickGen = new(5);
// create a numeric tick generator that uses our custom minor tick generator
ScottPlot.TickGenerators.NumericAutomatic minorTicks = new();
minorTicks.MinorTickGenerator = minorYAxisTickGen;
// comment : tell the left axis to use our custom tick generator
plt.Axes.Left.TickGenerator = minorTicks;
// comment : create a tick generator for the Y axis with a minimum tick spacing of 25 pixels
plt.Axes.Left.TickGenerator = new ScottPlot.TickGenerators.NumericFixedInterval(25);