0

This seems like it should be simple, but I was unable to find any line style or line width that allows one to have no line in a plot.

I want to draw to plots without a line (0 line width), and then use fillbetween to shade the area between the plots. Probably something obvious that I'm missing, but I couldn't find an equivalent no marks option like 'no line'.

MWE

\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}

Simply want this without the plot lines

3

Are you looking for 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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.