Rank: 19576 based on 0 downloads (last 30 days) and 0 files submitted
photo

Ben Woodacre

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Ben View all
Updated File Comments Rating
10 Feb 2009 Format Tick Labels Replace Tick Label with Specified Formattable Objects. Author: Alexander Hayes

You can fix the problem I described above by saving the text labels' positions and then restoring them after invoking format_ticks(). The following code could be shrunk a tad, but it's general enough in case you are using any type of units for the Position property.

% Save label positions
xl = get(gca,'xlabel');
yl = get(gca,'ylabel');
orig_label_units = get( xl, 'Units');
set([xl yl], 'Units','pixels');
xp = get( xl, 'Position');
yp = get( yl, 'Position');
% Generate the text object ticks (changing labels' Position):
[hx, hy] = format_ticks(gca,'{}','{}')
% Restore original label Position and Units properties:
set( xl, 'Position', xp);
set( yl, 'Position', yp);
set([xl yl], 'Units', orig_label_units);

09 Feb 2009 Format Tick Labels Replace Tick Label with Specified Formattable Objects. Author: Alexander Hayes

This is just what I have been looking for.

But when I add X and Y axis labels, they are positioned on top of the new text object ticks when MATLAB detects that the axis doesn't have proper axes ticks anymore.

Is there a way to turn off this last re-layout?

Top Tags Applied by Ben
axes, figure, latex, tick label
Files Tagged by Ben
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Aug 2007 Screenshot Format Tick Labels Replace Tick Label with Specified Formattable Objects. Author: Alexander Hayes annotation, axes, tick label, latex, figure, plot 291 22
  • 4.86667
4.9 | 17 ratings

Contact us at files@mathworks.com