Matlab画图导出Latex论文插图

f=figure;

subplot(2,1,1);
plot(t,zeros(1,1001),'k:','LineWidth',1.2);%参考值用黑色点线
hold on
plot(t,xn,'--','LineWidth',1.2);%用虚线,线粗一点
hold on 
plot(t,x,'LineWidth',1.4);%重要的数据用实线,线粗一点
legend('$x_{r}$','$x_n$','$x$','Interpreter','latex')%这样出来的字体是latex字体
axis([0 10 -0.1 0.3]);
xlabel('$Time(s)$','Interpreter','latex');ylabel('$x$','Interpreter','latex');

subplot(2,1,2);
plot(t,zeros(1,1001),'k:','LineWidth',1.2);
hold on
plot(t,[un un(1000)],'--','LineWidth',1.2);
hold on
plot(t,[u u(1000)],'LineWidth',1.4);
legend('$u_{r}$','$u_n$','$u$','Interpreter','latex');
axis([0 10 -0.5 0.5]);
xlabel('$Time(s)$','Interpreter','latex');ylabel('$u$','Interpreter','latex');


print(f,'Evolution','-depsc','-r600'); % 设置图片格式、分辨率
savefig(f,'Evolution.fig')

效果

 也可以在图窗里打开属性编辑器进行修改,感觉改完效果好点

 

修改完选择另存为eps格式,在latex中使用代码添加图片

\begin{figure}
    \centering
    \includegraphics[width=0.5 \textwidth]{Evolution.eps}
    \caption{Evolution}
\end{figure}

latex文档开头要添加包

\usepackage{graphicx}
\usepackage{epstopdf}

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值