matlab坐标轴操作大全


title(['The ' num2str(iter) 'th generation'], 'FontName','Times New Roman','FontSize',10);
xlabel('$x_{1}$','Interpreter','LaTex','FontName','Times New Roman','FontSize',10);

ylabel('$x_{2}$','Interpreter','LaTex','FontName','Times New Roman','FontSize',10);

gtext('\Omega^{0}','FontName','Times New Roman','FontSize',10);

set(gca,'XTick',[0:pi/3:2*pi]) 设置所要显示坐标轴刻度,

set(gca,'XTickLabel',[0:pi/3:2*pi]) 给这些数据加标签

set(gca,'FontName','Times New Roman','FontSize',10) 设置坐标轴字体

gca是单词Get current axes handle的缩写,获得坐标轴句柄。(不知道matlab为什么不自动对应数据加标签,还需要多一条命令)出来的图形

坐标轴标注:

1. 控制坐标轴尺度长度:set(gca,'XLim',[-pi/2 pi])

2. 定制自己想标注的刻度:

(1)set(gca,'XTick',[-pi/2:pi/4:pi]) %%%坐标轴最小值,步长,最大值

(2)set(gca,'XTickLabel',{'-pi/2' '-pi/4:' '0' 'pi/4' 'pi/2' 'pi*3/4' 'pi'})

3. 反转坐标轴:set(gca,'XDir','reverse')

4. 上下标及latex公式

输下标:_{wb}

输上标:^{0.5}

输latex公式:

text('Interpreter','latex',...

'String','$$\int_0^x\!\int_y dF(u,v)$$',...

'Position',[.5 .5],...

'FontSize',16)


在Matlab中输入上标、下标、特殊符号或字体:


bf,\it,\rm表示黑体,斜体,正体字符

上标用 ^(指数),下标用 _(下划线)

调用方式为: ^{任意字符}, _{任意字符}, 注意{}的使用!

希腊字母等特殊字符用 \加拼音如:
\后字母大写的,表示是大写(如Ω \Omega),小字母的,表示小写(如ω \omega)

α \alpha β \beta γ \gamma θ \theta Θ \Theta

Г \Gamma δ \delta Δ \Delta ξ \xi Ξ \Xi Ω \Omega

η \elta ε \epsilong ζ \zeta μ \miu υ \nu τ \tau

λ \lamda Λ \Lamda π \pi Π \Pi σ \sigma Σ \Sigma

φ \phi Φ \Phi ψ \psi Ψ \Psi χ \chi ω \omega

< \leq > \geq 不等于 \neq << \ll >> \gg

正负 \pm 左箭头 \leftarrow 右箭头 \rightarrow 上箭头 \uparrow

体会以下两例:

figure, title('\zeta^{-t}sint');

figure, title('x~{\chi}_{\alpha}^{2}(3)');

相关文档
最新文档