Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: MATLAB gui plot text handling depending on check box
Replies: 1   Last Post: Mar 19, 2013 7:03 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Rouzbeh

Posts: 9
Registered: 9/7/12
MATLAB gui plot text handling depending on check box
Posted: Mar 15, 2013 8:35 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hello,

I am designing a gui (my first one) with guide and I'm having some problems with certain plotting (text) options. I have two sets of axes objects in my gui which are used for graphing purposes. I also have a set of check boxes corresponding to each set of axes that do simple analysis (min, max, average). when each check box is toggled on, say for the "min" of "plot1" axes, a text box gets populated by a number corresponding to the minimum value of the data and a text object printed on the graph pointing to the corresponding value on the graph.

here's the code segment:

In my check box callback function :
axes(handles.Plot1);

if (get(handles.Panel1Min, 'Value') == get(handles.Panel1Min,'Max')) %check toggle on
if data1MinInd>floor((length(P1t)/2)-1)
handles.text = text(t(data1MinInd),data1Min,['some text']);
elseif data1MinInd<=floor((length(P1t)/2)-1)
handles.text = text(t(data1MinInd),data1Min,['some other text']);
end
else
set(handles.P1MinText,'String',''); % if toggled off, text box is cleared
end

what I'm struggling is clearing the text from the plot when the check box is toggled off.

Things I have tried:

1) saving the "text" handle object everytime the toggle is on (because when it's off the handle doesn't exist), and check it agains the toggle before the conditional statements above in the check box callback function.

2) using the delete command and passing the "text" handle object as an input argument.

Does the line "axes(handles.Plot1)" in anyway interfere with "text" handle assignment by making it a child?

I would appreciate any help or hints that would set me on the right path to solving the problem.

Thank you,

Rouzbeh



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.