论文修改 matlab绘图

经过一个多月的夺命论文修改,被各种奇葩的编辑要求所折磨。现在将论文修改中的matlab绘图做下总结。

plot(sod.R(1:5:end),sod.P(1:5:end),'LineWidth',0.5,'Color','r')

绘制线条时'LineWidth'修改线宽,'Color'修改颜色。

set(gca,'XTickLabel',{'0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0'},'FontSize',figure_FontSize)
set(gca,'YTickLabel',{'0.0','0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9','1.0'},'FontSize',figure_FontSize)

在修改坐标的值时遇到了坐标不能控制他的小数点个数,可能是我版本的问题,最后采用直接写死的方法。注意这个方法对应每一个坐标线,所有你放大或者缩小之后可以对不上,你在确定了坐标系之后再写死。'FontSize',figure_FontSize 控制坐标字符大小'FontName','Times New Roman'  控制坐标字体。

xlabel('\itR','FontName','Times New Roman','FontAngle','italic');% x轴名称
ylabel('\itP','FontName','Times New Roman','FontAngle','italic');

坐标名称上 \it(自己的命名)可以出斜体字体。在显示上只有保存eps或者pdf上会显示斜体。这个同样可以使用'FontSize',figure_FontSize 控制坐标字符大小'FontName','Times New Roman'  控制坐标字体。

plot(dclr,dclp,'m','LineWidth',1)
hold on

plot(dclr1,dclp1,'c','LineWidth',1)
hold on

hold on 在同一张图上绘线。

 

hl=legend('DCl','DCl+','DSS-','DSS','HED-DSN-','HED-DSN','Location','NorthEastOutside','FontName','Times New Roman','Location','SouthWest');
set(hl,'Box','off');

Location控制legend 位置

'North'              inside plot box near top
        'South'              inside bottom
        'East'               inside right
        'West'               inside left
        'NorthEast'          inside top right (default)
        'NorthWest           inside top left
        'SouthEast'          inside bottom right
        'SouthWest'          inside bottom left
        'NorthOutside'       outside plot box near top
        'SouthOutside'       outside bottom
        'EastOutside'        outside right
        'WestOutside'        outside left
        'NorthEastOutside'   outside top right
        'NorthWestOutside'   outside top left
        'SouthEastOutside'   outside bottom right
        'SouthWestOutside'   outside bottom left
        'Best'               least conflict with data in plot
        'BestOutside'        least unused space outside plot

后一句可以去除边框

猜你喜欢

转载自blog.csdn.net/a362682954/article/details/81258185