How can I handle visibility on/off for plot function?

조회 수: 258 (최근 30일)
Zara Khan
Zara Khan 2019년 2월 22일
댓글: Zara Khan 2019년 2월 23일
I am drawing circles over binary image using plot function. How can I keep the visibility off for the portion when the circle going through background and it will be on for image object portion ?

답변 (1개)

Kevin Phung
Kevin Phung 2019년 2월 22일
For graphic objects, there is a 'Visible' Property that you can adjust.
If you have a handle for your line object, for example:
a = plot(1:5,1:5); % a is your handle to the line
set(a,'Visible','off'); %'off' or 'on'
%or
a.Visible = 'off';
if you wish to do this beyond the scope of the original function, you can look for this line object by accessing the children of the axes.
g = gca; %gets the current axes
objs = g.Children %this will list all line objects in your g axes
%then from here you can index to the appropriate line object you want
  댓글 수: 1
Zara Khan
Zara Khan 2019년 2월 23일
This will either off the entire line or on the entire. But I want to keep a portion of the line on and a portion off at the same time. when the line will get image object it will be on and when it will get backgroung then it will be off.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by