这看起来很简单,但我无法找到任何线条样式或线宽使得图中没有线。
我想绘制线条不带线(0 线宽)的图,然后用它fillbetween
来遮蔽图之间的区域。可能我遗漏了一些明显的东西,但我找不到no marks
像“ no line
”这样的等效选项。
平均能量损失
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-3, xmax=3,
samples=100,
]
\addplot[name path=x3,] {x^3};
\addplot[name path=x2,] {x^2};
\addplot[gray, opacity=0.2] fill between[of=x3 and x2];
\end{axis}
\end{tikzpicture}
\end{document}
答案1
您在寻找吗draw=none
?
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-3, xmax=3,
samples=100,
]
\addplot[name path=x3,draw=none] {x^3};
\addplot[name path=x2,draw=none] {x^2};
\addplot[gray, opacity=0.2] fill between[of=x3 and x2];
\end{axis}
\end{tikzpicture}
\end{document}