Get the corresponding primary label by getting the MajorTicks method on the Y-axis
The value that should be zero in the middle becomes a very small value due to the accuracy problem。
Is there a solution
The precision of the axes
Moderator: Queue Moderators
The precision of the axes
- Attachments
-
- Y_MajorTicks.png (25.75 KiB) Viewed 4937 times
-
- Y_Axis.png (8.35 KiB) Viewed 4937 times
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: The precision of the axes
Hi,
As you noticed already, dividing axis range into equally spaced intervals/ticks not always end up in nice rounded numbers.
The main question, how do you convert the double values into label (string)? If you are calling .NET Value.ToString() method with no argument (IFormatProvider / string), then Default ("G") format is used. Unfortunately, this is how standard “G” formatting sometimes works (i.e. produce this long strings of meaningless values). The only workaround is to create own formatting string. For example, Value.ToString("0.00").
Check Standard and Custom numeric formats, which suit you best.
As you noticed already, dividing axis range into equally spaced intervals/ticks not always end up in nice rounded numbers.
The main question, how do you convert the double values into label (string)? If you are calling .NET Value.ToString() method with no argument (IFormatProvider / string), then Default ("G") format is used. Unfortunately, this is how standard “G” formatting sometimes works (i.e. produce this long strings of meaningless values). The only workaround is to create own formatting string. For example, Value.ToString("0.00").
Check Standard and Custom numeric formats, which suit you best.