Simple Matlab Axis Question
Simple Matlab Axis Question
(OP)
Hello,
I am creating a plot through a ".m" file. The problem I am having is that when I display the plot, the y-axis is scaled in the format 1.6 x 10-3 instead of 0.0016. Is there a property that sets the number format of the axis? I figuered it would be easy, but I have searched for sometime and havent had any luck. Thanks in advance,
Paul
I am creating a plot through a ".m" file. The problem I am having is that when I display the plot, the y-axis is scaled in the format 1.6 x 10-3 instead of 0.0016. Is there a property that sets the number format of the axis? I figuered it would be easy, but I have searched for sometime and havent had any luck. Thanks in advance,
Paul





RE: Simple Matlab Axis Question
The tick labels are string values. You can manually set them however you want:
set(gca,'XTickLabel',{'0.0000';'0.0016';'0.0032'})
If you want full automation, use 'get' to read in the current values, 'sprintf' to set the numerical format, and 'set' to update.
CV