Sometimes the exact location of some text annotation doesn't matter. This works just like TEXT (including the property calls) except one does not specify an X,Y location. The subroutine TSCAN (modified from the Matlab LSCAN routine) automatically places the text, with a preference for the bottom/left corner.
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".
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.
This is a great bit of code for what it does. Very easy to use, and exactly what I was looking for.
17 Oct 2006
Beautiful! This code does exactly what I want to achieve. A very nice, simple substiture for the MATLAB text command where hands-off annotation is desired!
25 Jun 2006
This is a code that I was looking for. Since a command "legend" has similar functionality I even though that there might be a command already. I have been using "legend" to put all information in the plot, which was pain in the neck. Now I can make a plot with all experimental parameters.