1

Using ILNumerics 3.3.3.0

I want to change the number of ticks on a particular axis to be every 1.0 units instead of every 5.0 units.

Can this be done in automatic mode?

Sam
  • 7,252
  • 16
  • 46
  • 65
JRS
  • 1,438
  • 2
  • 16
  • 26

1 Answers1

1

Automatic mode takes the available size for the axis into account and selects the 'optimal' spacing automatically. So it may gets a spacing based on 1, 2 or 5... You cannot control that.

What you CAN do: provide your own TickCreationFuncEx to specify the ticks semi-automatically:

IEnumerable<ILTick> MyTicksCreationFunc(float min, float max, int numberTicks, ILAxis axis, AxisScale scale = AxisScale.Linear) {
    IList<ILTick> ret = new List<ILTick>();
    for (int i = (int)Math.Floor(min); i < Math.Ceiling(max); i++) {
        ret.Add(new ILTick(i, i.ToString())); 
    }
    return ret; 
}

You provide this function to the TickCreationFuncEx of the corresponding axis then:

plotCube.Axes.XAxis.Ticks.TickCreationFuncEx = MyTicksCreationFunc;

So you can stay in auto-mode.

Haymo Kutschbach
  • 3,322
  • 1
  • 17
  • 25