On Tue, Mar 27, 2012 at 12:36 AM, financial engineer
<address@hidden> wrote:
how does one remove the text from a 2d plot.
I executed the following command and it worked, but now I want to remove the text without having to redo the graph all over again.
text(30,8545,"S","Color","g","FontWeight","bold","fontsize",15);
I tried text("remove") but it did not work....
The easiest way that I've found is to save the handle that is returned then call delete on the handle when you want to delete it like this:
h = text(0,0,"stuff");
<other interesting code>
delete(h);
If you have multiple texts that you want to print then delete, then you can simply have a vector that you can populate with the "h"s, then call delete on that vector.
James