TicksAngle is defined to be anti-clockwise from the axis direction for a positive angle (as is conventional for 2D coordinates).
However, existing code draws ticks at wrong (ie clockwise) rotation.
Demonstration: AxisTestsForm.cs.patch has extra X-axes drawn to show this problem.
Test code in: NPlot\demo\csharp\src\AxisTestForm.cs
Cause: Because the physical (pixel) origin in System.Drawing.Graphics is at the top left of the screen, rotations (as in RotateTransform) are clockwise. This
has caused some confusion when drawing the Ticks, and the existing code uses both the negative of the TicksAngle and the (A-B) trignometrical formula to
rotate the tick.
Resolution: The code in Axis.cs has been corrected and comments added to clarify its operation.
In addition, it is conventional to place ticks *outside* the plot area (ie to the left of the positive Y_axis and below the positive X-axis) so that the default
values for a new Axis should be:-
TicksAngle_ = 3.0f * PI / 2.0f; // or -PI/2.0f
TickTextNextToAxis = false;
and these changes have been made to the Axis constructor routine.
The axis constructors in PlotSurface2D.cs have the correct TicksAngle defined and do not need changing.
Only one of the demo routines (Mockup demo) uses specific values for TicksAngle, and the default values will now be correct. Lines have been removed
from PlotSurface2DDemo.cs to allow the default values to stand.
Note that in all demos, the Ticks are now drawn outside the plot area (which is the convention)
If the original appearance is preferred, TicksAngle must be set to PI/2.0f specifically.
Files affected:-
NPlot\src\Axis.cs;
NPlot\demo\charp\src\PlotSurface2DDemo.cs
NPlot\demo\csharp\src\AxisTestForm.cs
Code patches for 3 files