matlab 绘制的心形图 如何填充红色 MATLAB作图时,如何把标志数据点的形状做成实心的

\u5229\u7528matlab\u753b\u56fe\u547d\u4ee4\uff0c\u4ee5 \u4e3a\u5fc3\uff0c\u7ed8\u5236\u4e00\u4e2a\u6b63\u4e03\u8fb9\u5f62\uff0c\u5e76\u586b\u6d82\u6210\u7ea2\u8272\u3002\u5199\u51fa\u6267\u884c\u8bed\u53e5\u5e76\u753b\u56fe\u51fa\u5f62\u3002

\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5e0c\u671b\u6709\u6240\u5e2e\u52a9\u3002
% By lyqmath
clc; clear all; close all;
t = 0 : 2*pi/7 : 2*pi;
x = cos(t);
y = sin(t);
figure;
plot(x, y); box on; hold on; axis equal; axis square;
fill(x, y, 'r');
title('\u6b63\u4e03\u8fb9\u5f62 By lyqmath', 'FontWeight', 'Bold', 'Color', 'r');


% By lyqmath
clc; clear all; close all;
t = linspace(0, 2*pi);
x = cos(t);
y = sin(t);
x = x(1:round(length(x)/7):end);
y = y(1:round(length(y)/7):end);
figure;
plot(x, y); box on; hold on; axis equal; axis square;
fill(x, y, 'r');
title('\u6b63\u4e03\u8fb9\u5f62 By lyqmath', 'FontWeight', 'Bold', 'Color', 'r');

\u4ee3\u7801\u5982\u4e0b\uff1a
>> x = -pi:pi/10:pi;
>> y = tan(sin(x)) - sin(tan(x));
>> figure
plot(x,y,'--bs',...
'LineWidth',2,...
'MarkerSize',10,...
'MarkerFaceColor','b')
>> grid on

\u6269\u5c55\u8d44\u6599\uff1a\u6ce8\u610f\u4e8b\u9879
\u4e00\u3001\u7ed8\u5236\u5b9e\u5fc3\u5706\uff1a
pha=0:pi/20:2*pi;%\u89d2\u5ea6[0,2*pi]
R=2;%\u534a\u5f84
x=R*cos(alpha);
y=R*sin(alpha);
plot(x,y,'-')
axis equal
fill(x,y,'r');%\u7528\u7ea2\u8272\u586b\u5145
\u4e8c\u3001\u7ed8\u5236\u5b9e\u5fc3\u5706\u70b9\uff1a
plot(1:8,'ro','MarkerFaceColor','r');

不一定最好,但是实现了功能:

syms  x y
h=ezplot((x^2+y^2-1)^3-x^2*y^3,[-1.5,1.5]);
c = get(h,'ContourMatrix');
e = c(1,4:end);
f = c(2,4:end);
figure
fill(e,f,'r','edgecolor','r')




>> syms x y;
>> h = ezplot((x^2+y^2-1)^3-x^2*y^3);
>> x=get(h,'Xdata');y=get(h,'Ydata');
>> fill(x,y,'r')



扩展阅读:matlab动态爱心 ... matlab心形线动图 ... mathematica心形3d图 ... matlab生成眼图 ... 用matlab画3d心形图 ... 用matlab画一个动态心 ... matlab各种符号大全 ... matlab绘制立体爱心 ... 用matlab画跳动的爱心三维 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网