如何保留在圆之内的网格线。

8 views (last 30 days)
华纳公司注册账号【微8785092】
我想得到一个这样的图,所以画了网格线,以及一个填充的圆,效果如图2我想把圆外的网格线去掉,得到图1的样子,应该如何做
以下是我的代码
[X,Y] =meshgrid(-6.75:1.5:6.75);
z=X*0;
mesh(X,Y,z);
figure()
h1 = mesh(X,Y,z)
%hold on
%viscircles([0,0],6,'color','r')
axis off
hold on
t = 0:0.1:2*pi;
x = 6*sin(t);
y = 6*cos(t);
patch(x,y,'g')
%axis square tight
alpha(0.5)

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!