Creating a blank canvas in Matlab
30 次查看(过去 30 天)
显示 更早的评论
I am trying to replicate an experiment that has originally been done in Python, with Matlab. I would like to generate a bunch of circles of different sizes, colors and opacity and overlay them on top of each other inside a blank canvas. I would like to know if that is possible to be done in Matlab and what kind of commands I will need to use. For more details regarding the experiment please check the below link:
Thanks.
0 个评论
采纳的回答
更多回答(2 个)
Chris McComb
2015-2-23
I think that you should probably approach this using the patch command. This will allow you to specify circles with your desired parameters. The keyword alpha will allow you to control opacity.
% Size of circle
r = 5;
% Opacity
a = 0.1;
% Color
c = 'r';
theta = 0:0.1:2*pi;
x = r*cos(theta);
y = r*sin(theta);
patch(x, y, c, 'facealpha', a, 'edgecolor', c, 'edgealpha', a);
The additional argument of edgecolor and edgealpha make sure that the edge of the circle matches the interior.
Image Analyst
2015-2-23
I have a demo that does something pretty similar. See attached m-file below this image it creates.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!