MATLAB Answers

How to hide text in axes?

3 views (last 30 days)
han han
han han on 14 Mar 2020
Commented: Ahmed Anas on 14 Mar 2020
How to hide text in axes.
This is my code,and it doesn't hide the a1 in checkbox.
I want to change the state of the text through the checkbox, but obviously it can't do it. What should i do?
function checkbox3_Callback(hObject, eventdata, handles)
[Nodelocation] = textread('observe/mdNodeLocationXY_axisforGUI2.txt');
WISETEST = fopen('observe/mdNodeLocationXY_axisforGUI2.txt', 'rt');
out = textscan(WISETEST, '%s', 'Delimiter',{' '});
checkbox3_value = get(handles.checkbox3, 'Value');
ab = out{1}(1:end);
a1= length(str2double(ab))/6;
a = [0:a1-1]';
b = num2str(a); c = cellstr(b);
a1 = text(Nodelocation(:,2), Nodelocation(:,3), c);
if checkbox3_value == 1
set(a1, 'Visible', 'on')
elseif checkbox3_value == 0
set(a1, 'Visible', 'off')
end

  3 Comments

Ahmed Anas
Ahmed Anas on 14 Mar 2020
Please get checkbox value by trying this, hope it will provide you the required results. Otherwise send me the error.
checkbox3_value=get(hObject,'Value')
han han
han han on 14 Mar 2020
This way nothing has changed :(
Ahmed Anas
Ahmed Anas on 14 Mar 2020
It is showing you the text or not? you are getting errors while hiding this, am i right?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!