MATLAB Visualization (5): How to add words and labels on function graphs; how to draw basic three-dimensional images.

1. Add annotations and logos to the diagram, set the font size of the logo, etc.

%如何在函数图形上加字,做标识
clf;clear
t=0:pi/50:2*pi;%自变量取值
y=sin(t);plot(t,y);
axis([0,2*pi,-1.2,1.2])%设置坐标轴范围
text(pi/2,1.02,'\fontsize{16}\leftarrow\fontname{隶书}在\pi/2\fontname{隶书}处\itsin(t)\fontname{隶书}取极大值')
%内容解释:text(x,y,s)在图中(x,y)处标注内容为s
%字体大小为16磅,隶书,\it斜体字sin(t)

% Content explanation: text (x, y, s) is marked as s at (x, y) in the figure

%The font size is 16 points, official script, \it italic font sin(t)

 2. How to draw a simple 3D image

%如何绘制基本的三维图形
t= 0:pi/50:10*pi;
plot3(sin(t),cos(t),t)
grid on
axis square

 

 

Guess you like

Origin blog.csdn.net/m0_73982095/article/details/130646223