我用 matlab2tikz 生成了一个 tikz 文件。该图有对数模式的网格。但是,虽然 xmax=3x10^7,但它没有显示 2x10^7 处的网格,如下所示:
当我增加 xmax=4x10^7 时,它会正确显示所有网格,如下所示:
当 xmax=3x10^7 时,有没有简单的方法可以在 2x10^7 处添加网格?
这是一个错误吗?
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
% This file was created by matlab2tikz.
%
%The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz-matlab2tikz
%where you can also make suggestions and rate matlab2tikz.
%
\definecolor{mycolor1}{rgb}{0.00000,0.44700,0.74100}%
\definecolor{mycolor2}{rgb}{0.85000,0.33000,0.10000}%
\definecolor{mycolor3}{rgb}{0.93000,0.69000,0.13000}%
%
\begin{tikzpicture}
\begin{axis}[%
width=3.229in,
height=2.122in,
at={(0.542in,0.286in)},
scale only axis,
unbounded coords=jump,
xmode=log,
xmin=100000,
xmax=30000000,
xminorticks=true,
xlabel style={font=\color{white!15!black}},
xlabel={Frequency [Hz]},
ymin=30,
ymax=105,
ylabel style={font=\color{white!15!black}},
ylabel={Current [dBµA]},
axis background/.style={fill=white},
xmajorgrids,
xminorgrids,
ymajorgrids,
legend style={at={(0.03,0.03)}, anchor=south west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot [color=mycolor1, line width=2.0pt]
table[row sep=crcr]{%
120000 99.0045009826914\\
168000.000000003 94.0329250554461\\
216000 88.1265671014924\\
264000.000000003 85.0753459548058\\
311999.999999998 83.8360872591418\\
360000 82.5027662489753\\
407999.999999995 81.2608865356361\\
2963000.00000003 56.0899171397631\\
3011000.00000004 54.2962201226581\\
3441999.99999999 54.623001576856\\
3490000.00000003 53.7238229832034\\
22334999.9999997 47.3027911014257\\
22395999.9999999 49.7722178053978\\
22529000.0000002 47.9630513502279\\
22574999.9999998 50.1404369627122\\
22605000 47.6690243291318\\
29901000.0000002 52.7283448389326\\
30000000 52.073623376038\\
};
\addlegendentry{I}
\end{axis}
\end{tikzpicture}%
\end{document}