Why am I unable to relocate the text box using my mouse when creating a plot using PLOTYY?

I have created a plot using PLOTYY and I have placed a textbox in on the axes. However, I am unable to move this text box using my mouse cursor. The code that I am using is as follows:
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
plotyy(x,y1,x,y2,@semilogx);

 Accepted Answer

The text box has a parent axes and this axes does not seem to be the "Current Axes". To resolve this issue, use the following commands:
%Obtain the handle for the text object
t=findobj('Type','Text');
%Set the parent of the text object to be the current axes
set(t,'Parent',gca);

More Answers (0)

Categories

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!