4.0

4.0 | 2 ratings Rate this file 29 Downloads (last 30 days) File Size: 18.38 KB File ID: #23841

Format Tick Labels (Extended)

by Patrick Toche

 

20 Apr 2009 (Updated 26 Apr 2009)

Replace Tick Label with LaTeX compatible Objects. Extends file 15986 created by Alexander Hayes.

| Watch this File

File Information
Description

Will replace axes tick labels with formatted text objects that can include both Tex and LaTex interpreted strings. Primary example is to add degree symbols to labels. Inputs can be a cell array of strings or a single string to be appended to the end of each of the current labels. Header documentation includes several examples. Labels can also be rotated.

08/19/2007: Created by Alex Hayes
04/20/2009: Minor Update by Patrick Toche
Introduces a distinction between offsets for the horizontal axis offsetx and for the vertical axis offsety. It took 2 minutes to modify the original file, so credit must go to Alexander Hayes. Any errors are mine, of course.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Format Tick Labels

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
05 Jun 2011 Igor

Exactly what i was looking for...

However, 2 tiny suggestions:

To be able to use Y-ticks only one should replace 2 strings around #225 with
======================================
%find out if we have to use the LaTex interpreter
all_ticks = [tickx ticky];
temp = all_ticks{1};
======================================

it's also a bit unexpected that
offsety>0 means 'left' ...

25 Oct 2011 Robert Sparr

Very nice. I've wanted a way to do this for a long time.

Two improvements would be nice: (1) Add support for doing only Y ticks. (2) Check for an axis label and reposition it correctly so that it does not overlap with the new tick labels.

Please login to add a comment or rating.
Updates
26 Apr 2009

added a comment in the header about offsetx and offsety

Tag Activity for this File
Tag Applied By Date/Time
annotation Patrick Toche 21 Apr 2009 09:29:18
axes Patrick Toche 21 Apr 2009 09:29:18
customization Patrick Toche 21 Apr 2009 09:29:18
figure Patrick Toche 21 Apr 2009 09:29:18
tick label Patrick Toche 21 Apr 2009 09:29:18
plot Patrick Toche 21 Apr 2009 09:29:18
latex Patrick Toche 21 Apr 2009 09:29:18
annotation Trevor 07 Jan 2011 13:32:41

Contact us at files@mathworks.com