您的位置:首页 > 编程语言 > MATLAB

Matlab 图片绘制相关

2016-06-08 11:25 701 查看
MatLab图片绘制相关:

1. 图中绘制直线:

line([0.7,0.7],[100,400],'color','c','linestyle','--','linewidth',2);
2.LaTex格式标题:

z = xlabel('$$ $$ ');
set(z,'Interpreter','latex','FontSize',17,'FontWeight','bold');


3. 设定图中文字大小:
set(get(gca,'XLabel'),'FontSize',17);
set(get(gca,'YLabel'),'FontSize',15);
set(gca,'FontSize',13);
4. 旋转Y轴label:
ylabel('PSNR','FontName','Times New Roman','FontSize',14,'Rotation',0);
5.绘制双Y坐标轴:
[AX,H1,H2] = plotyy([1:N],Efficient,[1:N],Result(:,1),'plot');

set(AX(1),'XColor','k','YColor','b');
set(AX(2),'XColor','k','YColor','r');

HH1=get(AX(1),'Ylabel');
set(HH1,'String','something');
set(HH1,'color','b');
HH2=get(AX(2),'Ylabel');
set(HH2,'String','something');
set(HH2,'color','r');

set(H1,'LineStyle','-');
set(H1,'color','b');
set(H1,'LineWidth',2);
set(H2,'LineStyle','--');
set(H2,'color','r');
set(H2,'LineWidth',2);
legend([H1,H2],{'';''});
z = xlabel('i$$ $$ Synapse');
set(z,'Interpreter','latex','FontSize',15,'FontWeight','bold');
title('Bidirectional Loop');
line([0 10],[181 181],'linestyle','--','color','r','Linewidth',2,'parent',AX(2));
set(AX,'FontSize',13);
set(gca,'xtick',[1:N]);
set(get(AX(2),'Ylabel'),'FontSize',12);
set(get(AX(1),'Ylabel'),'FontSize',12);
set(get(AX(1),'Xlabel'),'FontSize',15);
set(get(AX(1),'title'),'FontSize',13);
6.
绘制双Legend:
h1 = plot(index,Contribution(2,:),'k*-','LineWidth',2);
hold on;
h2 = plot(index,Contribution(4,:),'cx:','LineWidth',2);
hold on;
h3 = plot(index,Contribution(1,:),'go-','LineWidth',2);
hold on;
h4 = plot(index,Contribution(5,:),'bx--','LineWidth',2);
hold on;
h5 = plot(index,Contribution(7,:),'r*-','LineWidth',2);
l1 = legend([h1,h2],'2th Synapse','4th Synapse');
copyobj(l1,gcf);
l2 = legend([h3,h4,h5],'1th Synapse','5th Synapse','7th Synapse');
xlabel('n');
ylabel('Contribution');
set(get(gca,'title'),'FontSize',15);
set(get(gca,'YLabel'),'FontSize',15);
set(get(gca,'XLabel'),'FontSize',15);
set(gca,'FontSize',13);
7. 设定横坐标标度内容:
xlabel('JPEG','FontName','Times New Roman','FontSize',14);
ylabel('EBR','FontName','Times New Roman','FontSize',14,'Rotation',0);
set(gca,'FontName','Times New Roman','FontSize',14);
set(gca, 'XTick', [1 2 3 4]);
set(gca,'XTickLabel',{'30','50','70','90'});
8. 绘制散点图:
for i=1:PreStepMat_y
ArrayTmp = PreStepMat(:,i);
scatter(Sparse,ArrayTmp,'b*');
hold on;
end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  matlab