给figure的轴、线加标签和注释

x = -pi:.1:pi;
y = sin(x);
plot(x,y)
set(gca,'XTick',-pi:pi/2:pi)
set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'})

xlabel('-\pi \leq \Theta \leq \pi')
ylabel('sin(\Theta)')
title('Plot of sin(\Theta)')
text(-pi/4,sin(-pi/4),'sin(-\pi\div4) \rightarrow',...
     'HorizontalAlignment','Right')
 
 set(findobj(gca,'Type','line','Color',[0 0 1]),...
    'Color',[1,0,1],'LineWidth',10)
给figure的轴-线加标签和注释.png

你可能感兴趣的:(给figure的轴、线加标签和注释)