MATLAB 如何去除FILL生成的图形的边界线

我想把三角形网格给去了,请问怎么办?谢谢!
2024-11-23 02:01:40
推荐回答(4个)
回答(1):

上午遇到了同样的问题,加了条语句set函数对线型设置。你可以将set注释上看看效果

clc;

clear all;

x1=[0 ,1 ,1 ,0];

y1=[0, 0, 1 ,1];  %定义四个点 [0 0] [1 0] [1 1] [0 1]

H_F1=fill(x1,y1,[0.0, 0.1, 0.2 ,0.5]);  %定义四个点的C值

set(H_F1,{'LineStyle'},{'none'}) %设置颜色和线宽

hold on

x2=[1 ,2 ,2 ,1];

y2=[1, 1, 2 ,2];

H_F2=fill(x2,y2,[0.3, 0.2, 0.2 ,0.7]);  %定义四个点的C值

set(H_F2,{'LineStyle'},{'none'}) %设置颜色和线宽

hold on

x3=[0 ,1 ,1 ,0];

y3=[1, 1, 2 ,2];

H_F3=fill(x3,y3,[0.5, 0.1, 0.4 ,0.5]);  %定义四个点的C值

set(H_F3,{'LineStyle'},{'none'}) %设置颜色和线宽

hold on

x4=[1 ,2 ,2 ,1];

y4=[0, 0, 1 ,1];

H_F4=fill(x4,y4,[0.5, 0.1, 0.4 ,0.5]);  %定义四个点的C值

set(H_F4,{'LineStyle'},{'none'}) %设置颜色和线宽

回答(2):

去掉matlab图形边界线方法一:

surf(peaks)
shading interp
set(gca,'position',[0 0 1 1])
print -dtiff 'x.tif'

去掉matlab图形边界线方法二:

x=-2*pi:0.1:2*9i;
y=sin(x);
figure; 
plot(x,y,'k-') %节点位移图形输出
set (gca,'position',[0,0,1,1])

最后在图形文件figure的菜单上点击file->export setup 
size选项中,对"expand axes to fill figure"选项打勾,如下图:

回答(3):

我不知道该给你怎么说,你参考这个程序
clear
clc
%% 初始化值
dt=0.001;% The sample interval, you can also set it to 0.001 or 0.004.
xt=0.06;% The length of wavelet(s), you can change it.
ht=0.3; % The length of h(t), namely reflection coefficient.
fm=40; % The main frequency of Ricker wavelet, you can change it.
%% 生成Ricker子波
nw=xt/dt;
nw=2*floor(nw/2)+1;
nc=floor(nw/2);
i=1:nw;
alpha=(nc-i+1).*fm*dt*pi;
beta=alpha.^2;
w=(1.-beta.*2).*exp(-beta);
m=length(w);
subplot(311),plot(w,'k');
title('雷克子波');
%% 生成反射系数序列
ny=ht/dt;
for i=0:ny
h=0.0;
end
h(20)=0.5;
h(80)=-0.5;
h(130)=0.5;
h(135)=-0.5;
h(300)=0.0;
n=length(h);
subplot(312),plot(h,'k');

title('反射系数');
%% 求卷积并得到合成地震记录
y=conv(w,h);
j=0:n-1;
y1=y(j+nc);
%subplot(313),plot(y1,'k');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
N = length(y1);
NN = 1 : N;
test_p = y1;
test_m = y1;
for ii = 1 : N
if(test_p(ii) <= 0)
test_p(ii) = 0;
end
if(test_m(ii) <= 0)
test_m(ii) = 0;
end
end
subplot(313),fill(NN,test_p,'k');
% subplot(313),fill(NN,test_m,'w');
hold on;
subplot(313),plot(y1,'k');
hold off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
title('合成记录');

回答(4):

grid off 是关掉格网
好像不对,你说的再详细点啊