How can I handle visibility on/off for plot function?
Afficher commentaires plus anciens
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 ?
Réponses (1)
Kevin Phung
le 22 Fév 2019
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
2 commentaires
Zara Khan
le 23 Fév 2019
Witek Jachimczyk
le 3 Juin 2026 à 19:00
Hi Zara,
Is a graphics plot overlay needed? Could you work with images directly?
Here is one possibility:
- you can create the circles using insertShape function: https://www.mathworks.com/help/vision/ref/insertshape.html and draw them into a new blank image (matrix)
- then use imblend to create your composite image; you'd use it with the mask syntax so that your binary image is used as a mask and defines which pixels will bleed through to your destination image
Hopefully, these tips will lead you to a solution that you desire.
Cheers,
Witek
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!