Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The problem is that matlab "cuts" some numbers and I do not recognize actual value. Look at the screenshot, on Y there are a lot of "0.0156" while I expect "0.01562" "0.01564" "0.01566" etc.

screenshot

How to say matlab to display enough numbers so I can recognize actual value?

share|improve this question
1  
Ther is an active group of Matlab programmers at StackOverflow. Have a look at the Matlab tags and consider posting there. –  ephsmith Jul 21 '12 at 15:09
    
@ephsmith thanks, next question will go to StackOverflow :) –  javapowered Jul 21 '12 at 16:55
add comment

2 Answers

up vote 1 down vote accepted

The ability to specify the precision of the tick labels on an axis is not available in MATLAB 7.3 (R2006b).

To work around this issue, you can retrieve the ticks, convert them to strings with a specified precision, and set the labels to the new tick labels. The following example code can be executed at the MATLAB command prompt, to illustrate this work around:

% Create an example plot.
plot(1:10);

% Query xTick numerical values.
xTick = get(gca,'xTick');

% Create strings out of xTick numerical values with a prescribed precision.
% The format string '%a.bf' means to present the values within a field that
% is wide enough to fit 'a' digits with 'b' digits after the decimal point
% in the format of a 'f'loating point number.
xTickLabel = arrayfun( @(x) sprintf('%3.2f',x), xTick, 'uniformoutput', false); 

% Use xTickLabel on the plot.
set(gca, 'xTickLabel', xTickLabel);

Note that once the tick labels have been set, they are in manual mode. The tick labels will not update automatically with the resizing of the figure window or zooming in and out of the window.

Ref: https://www.mathworks.com/support/solutions/en/data/1-3P8CU0/index.html

share|improve this answer
add comment

This may not be the nicest solution but it should allow you to distinguish the values:

Multiply all values by 1000, then just add a label or title that makes clear that the values are multiplied by 1000.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.