Matlab, how to adjust axis values ​​in figures (scientific notaiton - not enough accuracy)

Possible duplicate:
Suppress exponential formatting in numbers

Matlab displays my axis markers as 5.777 x10 ^ 6 for each checkmark in my drawings ... is it possible to get matlab to display the actual decimal number, not scientific notation, so the mark marks are actually different values, and not all 5.777? Currently, I do not know where in space these stories are due to the lack of accuracy on the axis.

+4
source share
2 answers

One possible solution:

plot(rand(100,1).*1e6) set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%d')) 

Obviously, you can customize the formatting to your liking.

enter image description here


Another example for x-axis ticks. In this case, the labels will overlap with each other. One possible solution is to use the XTICKLABEL_ROTATE function from file Exchange.

 plot(5.77*1e6:5.77*1e6+9, rand(1,10)) set(gca, 'XTickLabel', num2str(get(gca,'XTick')','%d')) %#' xticklabel_rotate([],45) %# rotate the xtick-labels 45 degrees 

enter image description here

+8
source

As a quick hack, try subtracting 5777 x10 ^ 6 from all x values.

+1
source

All Articles