我有以下 MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.pathmorphing}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\draw node[draw, decorate, decoration={random steps}] (box) at (0,0) {
\begin{tikzpicture}
\tikzset{decorate=false} % does not affect axes
\begin{axis}
\addplot[] table[row sep=crcr] {
30 4\\
42 4\\
42 3.5\\
50 3.5\\
};
\end{axis}
\end{tikzpicture}
};
\end{tikzpicture}
\end{document}
\tikzset{decorate=false}
用于禁用图形本身的修饰,但不能禁用其轴上的修饰:
如何禁用整个情节的装饰?
答案1
在这种情况下,您似乎需要设置decoration={name=none}
禁用装饰:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.pathmorphing}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\draw node[draw, decorate, decoration={random steps}] (box) at (0,0) {
\begin{tikzpicture}
\tikzset{decoration={name=none}}
\begin{axis}
\addplot[] table[row sep=crcr] {
30 4\\
42 4\\
42 3.5\\
50 3.5\\
};
\end{axis}
\end{tikzpicture}
};
\end{tikzpicture}
\end{document}