How to plot a circular Image?
3 次查看(过去 30 天)
显示 更早的评论
I want to plot a binary image like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165929/image.png)
However, I only want the red region to be shown in the figure.How can I do this?
tnx in advance
1 个评论
Geoff Hayes
2014-7-21
Ramin - what exactly are your inputs to draw the above? Do you determine the radius of the red circle? Do you decide on the number of solid black balls that fill the red region? Do you decide on the radius of each solid black ball?
采纳的回答
更多回答(1 个)
Robert Cumming
2014-7-21
A couple of options for you:
% First create an axes and some data:
ax = axes;
ang=0:0.01:2*pi;
xp=1*cos(ang);
yp=1*sin(ang);
patch ( xp, yp, 'w', 'parent', ax )
axis ( ax, 'equal' )
% option 1 - hide the axes to leave your image:
set ( ax, 'visible', 'off' )
% option 2 - set the background of your image to be the same as the parent:
set ( ax, 'color', get ( get ( ax, 'parent' ), 'color' ) )
2 个评论
Robert Cumming
2014-7-21
My example draws a circle as an example. You would need to remove that part. You only need the last part which hides the axes, or changes the background colour.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!