>someone" wrote in message <firstname.lastname@example.org>... > "Jonathan " <email@example.com> wrote in message <firstname.lastname@example.org>... > > Hi, > > > > I've developed code to plot a figure with text at specific locations; these locations vary spatially depending on various parameters that are previously selected. What I would like to do is where the text cover lines on the plot, there's a textbox at that location that has a white background color so that the text is clear to see. Is there a way to do this in Matlab. I know wher to place the text but can't figure out how to automatically assign a textbox to that location of a specific size. > > > > Thanks > > Jon > > % You should be able to use the BackgroundColor & EdgeColor > % text propererties to achieve the effects you want. > > doc text > > % and click on the Text Properties link at the bottom of the page. > % Use the format: > > text(x,y,z,'string','PropertyName',PropertyValue....)
Thanks for the help. However, I'm familiar with using text. What I was trying to do was place a textbox at the same location as my text using code. The latter is easy to do since it can be done by code based on xy parameters that can be specified automatically. However, the former is a little trickier since you are dealing with figure coordinates that are different from data coordinates. In the end I figured out way using a nifty tool called plotboxpos, which finds the position of the axes relative to the figure.