我想在LaTeX文档中包含我的数字但有以下问题。
打印数字为EPS无效。图被错误地裁剪。请参见下图。
如何使用句柄在循环中打印多个数字?
我的数据:
str=[...
'15.12.2012 11:27'
'15.12.2012 11:12'
'15.12.2012 10:57'
'15.12.2012 10:42'
'14.12.2012 10:27'
'14.12.2012 10:12'
'14.12.2012 09:57'
'14.12.2012 09:42'
'14.12.2012 09:27'
'14.12.2012 09:12'
'14.12.2012 08:57'
'13.12.2012 08:42'
'13.12.2012 08:27'
'13.12.2012 08:12'
'13.12.2012 07:57'
'13.12.2012 07:42'
'13.12.2012 07:27'
'12.12.2012 07:12'
'12.12.2012 06:57'
'12.12.2012 06:42'
'12.12.2012 06:27'
'12.12.2012 06:12'
'11.12.2012 05:57'
'11.12.2012 05:42'
'10.12.2012 05:27'
'10.12.2012 05:12'
'10.12.2012 04:57'];
Col1=[...
0.9884753
1.670642
1.14455
1.0301446
0.99031037
1.0459388
0.97192177
0.8925
0.8985693
0.955
0.95103529
0.95203444
0.955
0.95970876
0.95929422
0.95578656
0.955
0.955
0.95342687
0.955
0.955
0.95930485
0.95530825
0.96452381
0.9675
0.98778061
1.3];
Col2=rand(27,1).*(Col1);
Col3=Col1+Col2;
% find first occurrence of dates
[y,m,d,h,mn] = datevec(str,'dd.mm.yyyy HH:MM');
dn = datenum(y,m,d);
[~,ind] = unique(dn,'first');
ind = sort(ind);
% plot it nicely
plot(Col1);
hold all
plot(Col2);
hold all
plot(Col3);
leg_h=legend('bus','Car', 'truck','Location','NorthEastOutside');
set(leg_h,'Interpreter','latex','fontsize',14)
xlabel('time $t$','Interpreter','latex','fontsize',12);
ylabel('speed $m$','Interpreter','latex','fontsize',12);
ax = gca;
dstr = cellstr(datestr(dn,'dd.mm.yyyy'));
set(ax, 'XTick',ind, 'XTickLabel',dstr(ind), 'Position',[0.1,0.15,0.8,0.75]);
ylim([-20 20]);
% plot something...
print -deps epsFig
LaTeX代码:
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth, angle=0]{epsFig.eps}
\caption{Insert caption}
\end{figure}
答案 0 :(得分:4)
创建一个数字(不确定代码部分无效的原因)
手柄=图;
..生成情节..
export_fig(句柄,....)