Rank: 1957 based on 76 downloads (last 30 days) and 4 files submitted
photo

Peter Mao

E-mail
Company/University
Caltech
Lat/Long
34.13539886474609, -118.126350402832

Personal Profile:

 

Watch this Author's files

 

Files Posted by Peter Mao View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
06 Jun 2013 Call 2D real functions with complex numbers (cmplx.m) A wrapper function to allow use of complex numbers in functions of the form F(X,Y,...). Author: Peter Mao complex numbers, plotting, scatter 6 0
01 Aug 2011 subarray Extracts a subarray from an array. Useful for function outputs. Author: Peter Mao array, array manipulation, matrix, subarray, submatrix, subset 20 3
21 Jun 2011 Screenshot textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao annotation, customization, text, location, best, automatic 41 14
  • 4.44444
4.4 | 9 ratings
09 Jun 2006 Compact data uncertainty format given data and uncertainty, this program reformats the number into parenthetic notation. Author: Peter Mao strings, parentheses, confidence interval, uncertainty, format, parenthetical 9 2
  • 5.0
5.0 | 1 rating
Comments and Ratings by Peter Mao View all
Updated File Comments Rating
20 May 2013 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao

Ian -- legend tends to take the best upper-right position, while textbp looks for the best lower-left position. If your plot is fairly dense with data, they may decide on the same spot. textbp only pays attention to the data, it doesn't know where the legend is placed.

Alireza -- this is hard to debug without the error message. I'm going to guess that you put it somewhere where it's not in your path. Try "which textbp" or "path".

09 Jun 2011 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao

Jamal -- As I recall, that's related to a problem that occurs when translating between figure and axis normalized coordinates. I took it up w/ Mathworks years ago, with no satisfactory resolution, so there it stands.

09 Jun 2011 subarray Extracts a subarray from an array. Useful for function outputs. Author: Peter Mao

I've noticed recently that using ":" in scripts works fine, but in a function, the call to subarray gets evaluated as the unknown variable "subarray"

Haven't got a solution for that yet.

09 Jun 2011 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao

Adrien -- the trick is to rejigger TSCAN so it goes from top-left to bottom-right. I'll do that if I can find some time. It's been a long time since I looked at the code!

Comments and Ratings on Peter Mao's Files View all
Updated File Comment by Comments Rating
13 Jun 2014 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Holger Hoffmann

same issue as Matthew Crema
- no subplots
- the problem is "tscan"

"Undefined function or variable "pop".

Error in tscan (line 136)
minpop = min(min(pop));"

06 Feb 2014 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Matthew Crema

It does not work for me, and the error message is:

Undefined function or variable "pop".

I have a lot of subplots in one figure, which may make the task difficult.

20 May 2013 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Peter Mao

Ian -- legend tends to take the best upper-right position, while textbp looks for the best lower-left position. If your plot is fairly dense with data, they may decide on the same spot. textbp only pays attention to the data, it doesn't know where the legend is placed.

Alireza -- this is hard to debug without the error message. I'm going to guess that you put it somewhere where it's not in your path. Try "which textbp" or "path".

17 May 2013 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Alireza

It doesn't work for me but maybe I'm doing something wrong. I added the folder in the toolbox folder of Matlab and I'm using textbp('some string') after I plot some data. Is that right?

09 May 2013 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Ian

This works well on its own, but it does not seem to play well with the legend command (MATLAB R2013a). Both legend and textbp choose the same overlapping 'best' spot.

Contact us