From: SourceForge.net <no...@so...> - 2008-06-23 11:03:25
|
Bugs item #2000693, was opened at 2008-06-23 12:03 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=821568&aid=2000693&group_id=161868 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Hywel Thomas (hywelthomas) Assigned to: Nobody/Anonymous (nobody) Summary: Axis Ticks drawn at wrong angle Initial Comment: 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 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=821568&aid=2000693&group_id=161868 |