我尝试将 matlab 导出的 tikz 文件(matlab2tikz)包含到 latex 中,但如果不使用 matlab 默认颜色,则会收到错误消息。我不明白问题所在?!提前感谢你们
错误:
!非法计量单位(插入 pt)和 !缺失数字视为零
乳胶:
\begin{figure}[!h]
\centering
\setlength\fheight{0.7\textwidth}
\setlength\fwidth{0.9\textwidth}
\includegraphics{img/image1.tikz}
\caption{Blabla}
\label{fig:blabla}
\end{figure}
TIKZ 文件
% This file was created by matlab2tikz v0.4.7 running on MATLAB 8.1.
% Copyright (c) 2008--2014, Nico Schlömer <[email protected]>
% All rights reserved.
% Minimal pgfplots version: 1.3
%
% The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
% where you can also make suggestions and rate matlab2tikz.
%
\begin{tikzpicture}
\begin{axis}[%
width=\fwidth,
height=\fheight,
view={322.5}{30},
scale only axis,
xmin=-0.2,
xmax=1.2,
xmajorgrids,
ymin=-1,
ymax=1,
ymajorgrids,
zmin=-0.1,
zmax=1.5,
zmajorgrids,
axis x line*=bottom,
axis y line*=left,
axis z line*=left
]
\addplot3 [color=blue,solid]
table[row sep=crcr] {0.001 0.001 0.001\\
};
\addplot3 [color=white!96!green,solid,line width=2.0pt]
table[row sep=crcr] {0.479697819765937 -1.66533453693767e-18 -0.00291092455504537\\
0.46967140529907 -1.72084568816899e-17 -0.00304749019655101\\
};
\addplot3 [color=white!94!green,solid,line width=2.0pt]
table[row sep=crcr] {0.489715272722715 1.22124532708768e-17 -0.0027807983753805\\
0.479697819765937 -1.66533453693767e-18 -0.00291092455504537\\
};
\addplot3 [color=white!92!green,solid,line width=2.0pt]
table[row sep=crcr] {0.49972270061696 1.99840144432529e-17 -0.00265670325886659\\
0.489715272722715 1.22124532708768e-17 -0.0027807983753805\\
};
\addplot3 [color=white!90!green,solid,line width=2.0pt]
table[row sep=crcr] {0.509720409510899 2.66453525910038e-17 -0.00253825813233725\\
0.49972270061696 1.99840144432529e-17 -0.00265670325886659\\
};
...etc.
\addplot3 [color=white!26!red,solid,line width=2.0pt]
table[row sep=crcr] {0.829795595454906 -0.105304898583202 1.38110200542629\\
0.819887002709082 -0.107828908692529 1.38122697033729\\
};
\addplot3 [color=white!24!red,solid,line width=2.0pt]
table[row sep=crcr] {0.839625002204565 -0.102840751537362 1.38096723284625\\
0.829795595454906 -0.105304898583202 1.38110200542629\\
};
\addplot3 [color=white!22!red,solid,line width=2.0pt]
table[row sep=crcr] {0.849338403333923 -0.100435918845974 1.38082311765581\\
0.839625002204565 -0.102840751537362 1.38096723284625\\
};
\addplot3 [color=white!20!red,solid,line width=2.0pt]
table[row sep=crcr] {0.858894935151754 -0.0980874166907242 1.38067020233289\\
0.849338403333923 -0.100435918845974 1.38082311765581\\
};
\addplot3 [color=white!18!red,solid,line width=2.0pt]
table[row sep=crcr] {0.868252379508359 -0.0957923868952757 1.38050895947337\\
0.858894935151754 -0.0980874166907242 1.38067020233289\\
};
\addplot3 [color=white!16!red,solid,line width=2.0pt]
table[row sep=crcr] {0.877369369839138 -0.0935501070091226 1.38033968037477\\
0.868252379508359 -0.0957923868952757 1.38050895947337\\
};
\addplot3 [color=white!1.400000e+01!red,solid,line width=2.0pt]
table[row sep=crcr] {0.886207753298735 -0.0913610489013081 1.38016252820557\\
0.877369369839138 -0.0935501070091226 1.38033968037477\\
};
\addplot3 [color=white!12!red,solid,line width=2.0pt]
table[row sep=crcr] {0.894734885516806 -0.089226416250731 1.37997756748673\\
0.886207753298735 -0.0913610489013081 1.38016252820557\\
};
\addplot3 [color=white!10!red,solid,line width=2.0pt]
table[row sep=crcr] {0.902923998583969 -0.0871451464648408 1.37978494412629\\
0.894734885516806 -0.089226416250731 1.37997756748673\\
};
\addplot3 [color=white!8!red,solid,line width=2.0pt]
table[row sep=crcr] {0.910755941285036 -0.0851129457921532 1.37958495399157\\
0.902923998583969 -0.0871451464648408 1.37978494412629\\
};
\addplot3 [color=white!6!red,solid,line width=2.0pt]
table[row sep=crcr] {0.918222014540111 -0.0831254886403127 1.37937794641879\\
0.910755941285036 -0.0851129457921532 1.37958495399157\\
};
\addplot3 [color=white!4!red,solid,line width=2.0pt]
table[row sep=crcr] {0.9253245154501 -0.0811820599220048 1.37916419853541\\
0.918222014540111 -0.0831254886403127 1.37937794641879\\
};
\addplot3 [color=white!2!red,solid,line width=2.0pt]
table[row sep=crcr] {0.932071571122559 -0.0792840566576747 1.37894400837872\\
0.9253245154501 -0.0811820599220048 1.37916419853541\\
};
\addplot3 [color=red,solid,line width=2.0pt]
table[row sep=crcr] {0.938471567465238 -0.0774304719790548 1.37871788704809\\
0.932071571122559 -0.0792840566576747 1.37894400837872\\
};
\addplot3 [color=black,line width=4.0pt,mark size=6.5pt,only marks,mark=o,mark options={solid}]
table[row sep=crcr] {0.938471567465238 -0.0774304719790548 1.37871788704809\\
};
\addplot3 [color=red,line width=2.0pt,mark size=6.5pt,only marks,mark=o,mark options={solid}]
table[row sep=crcr] {0.938471567465238 -0.0774304719790548 1.37871788704809\\
};
\end{axis}
\end{tikzpicture}%
答案1
提供颜色时,数字格式似乎不匹配。
color=white!1.400000e+01!red
该包不支持该语法xcolor
;它需要混合表达式中的定点数。
将其更改为color=white!14!red
可解决问题。