Friday, May 20, 2011

Making pretty Figures in Matlab

I had a function calling these with gca option.
h = figure;
%plot

set(h,'LineWidth',1.12);
x_label = 'Class';
y_label = 'Range';
fig_title = char(DATAVAR);
% DATAVAR = variables{j}; from the loop and string list created as a cell structure.
% variables = {'Var1', 'Var2'} etc.
fig_title = regexprep(fig_title, '_', ' ');% To remove the underscores

xlabel(x_label, 'FontSize',[16], 'FontWeight' ,'bold');
ylabel(y_label, 'FontSize',[16], 'FontWeight' ,'bold');
newTitle = [fig_title]; % get the title from File Name (fn)
title(newTitle, 'FontSize',[20], 'FontWeight' ,'bold' );
set(gca,'LineWidth',[2.0], 'FontSize',[14],'FontWeight','bold')

No comments: