我正在努力自动化两种不同风格的情节。我想用matlab2tikz导出一个数字,然后将它分别包含在我定义的样式中。
首先是一个Matlab示例:
x = 0:10;
y = 0:10;
plot(x,y)
matlab2tikz(myfile_FirstStyle.tikz,'extraCode',FirstStyle, 'height', '\fheight', 'width', '\fwidth','showInfo', false,'extraaxisoptions', ['style=FirstStyle']);
我不确定,如果甚至可以创建一种风格:' extraaxisoptions',[' style = FirstStyle'] 至少它没有用。
现在跟随我在Latex中的尝试:
\documentclass{article}
\usepackage{pgfplots,filecontents}
\usepackage{grffile}
\usepackage{amsmath}
\usepackage{tikzscale}
\usepackage{siunitx}
\usepackage{tikz}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Specific Style: FirstStyle
\pgfplotsset{FirstStyle/.append style={
width=\fwidth,
height=0.70\fwidth,
ymin=0,
ymax=10,
ylabel=$FirstStyle$,
legend pos=north west,
}
}
\newlength\fheight
\newlength\fwidth
\setlength\fheight{0.68\textwidth}
\setlength\fwidth{0.85\columnwidth}
\begin{document}
\centering
\begin{figure}
\input{myfile_FirstStyle.tikz}
\caption{This is the FirstStyle}
\end{figure}
\end{document}
有没有办法使用Matlab2tikz预定义一个人的风格? 非常感谢你的帮助,任何想法都表示赞赏。 普拉亚