Thursday, July 9, 2015

MATLAB uniform ticks (uniformticks) and printing

The following script can make the axes nicer. Example:

%% render uniform ticks digits on Y axis
function uniformticks_y(deci) ; % input number of decimals as string
command = ['%0.' mat2str(deci) 'f|'] ;
ticks = get(gca, 'Ytick') ;
set(gca, 'YTickLabel', sprintf(command, ticks));

However, changing the graph manually in the GUI can upset the nice axes settings. Simply rerun the script from the console without closing the graphs.

No comments:

Post a Comment