Code covered by the BSD License  

Highlights from
pilabels

4.0

4.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 2.56 KB File ID: #27010
image thumbnail

pilabels

by Alan B

 

18 Mar 2010 (Updated 18 Mar 2010)

Automatically replaces xticklabels with rational multiples of pi.

| Watch this File

File Information
Description

- picks reasonable limits and ticks
- uses latex for pretty fractions if necessary
- replaces old labels produced by previous calls
- does NOT autocorrect on zoom/pan/resize

algorithm:
- choose limits as smallest n such that pi/n < x_data_range
- optional: increase n to next smallest "round" number
  - "round" means "power of 2" right now; could be a*b^n with a<b, 2^a*3^b, etc
- choose step size as smallest d that ensures at least L tick marks

I'm sure there are plenty of bugs

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
19 Mar 2010 Jonas Lundgren

I like this! It would be nice if the y-labels got the same font. Some parameters should be arguments, e.g. FONT_SIZE and MIN_TICKS.

Please login to add a comment or rating.
Updates
18 Mar 2010

added tags

Tag Activity for this File
Tag Applied By Date/Time
signal processing Alan B 18 Mar 2010 11:19:58
xtick Alan B 18 Mar 2010 12:48:54
ticklabel Alan B 18 Mar 2010 12:48:54
tick Alan B 18 Mar 2010 12:48:54
xticklabel Alan B 18 Mar 2010 12:48:54
axis Alan B 18 Mar 2010 12:48:54
latex Alan B 18 Mar 2010 12:48:54

Contact us at files@mathworks.com