Using ZedGraph, how do I format the Y axis to show 2000 instead of 2 with a label of MyLabel(10^3)?
Set the scale's Format Property to, say, "#" and the Mag Property to zero. For example:
YAxis y = myPane.YAxis;
y.Scale.Format = "#";
y.Scale.Mag = 0;
Set the MagAuto property to false:
zedGraph.GraphPane.YAxis.Scale.MagAuto = false;
Note that clicking on "Set Scale to Default" in the ZedGraph context menu will reset MagAuto to true. This is the source of a part of the context menu event handler:
public void ResetAutoScale( GraphPane pane, Graphics g )
{
_scale._minAuto = true;
_scale._maxAuto = true;
_scale._majorStepAuto = true;
_scale._minorStepAuto = true;
_crossAuto = true;
_scale._magAuto = true;
//this.numDecAuto = true;
_scale._formatAuto = true;
pane.AxisChange( g );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With