# How to remove the frame and keep the axis labels in pgfplots?

I have a simple pgfplots graph taken from PGFPlots Gallery

\begin{tikzpicture}
\begin{axis}
\addplot+[ybar] plot coordinates {(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}


I would like to remove the frame (the vertical line, the horizontal line and the dashes in these lines) but keep the xtick and ytick labels.

How can I do this?

NB. I am trying to produce this image that's why I need to remove the frame:

• Some hints at least can be found in tex.stackexchange.com/questions/367189/… – Torbjørn T. May 11 '17 at 22:03
• Thank you. I need to add these two lines: every outer y axis line/.style={draw=none} and tick style={draw=none}. – Ribz May 11 '17 at 22:07

Adjust the axis-options. You can add:

  axis line style={draw=none},
tick style={draw=none}


The second option removes the ticks too.

Something like this?

\documentclass[margin=2mm,tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis line style={draw=none},
tick style={draw=none},
ylabel = {Exabytes\\ per month},
ylabel style={align=center,rotate=-90},
]
\addplot+[ybar] plot coordinates {(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}
\end{document}


I have also added the Y axis label with the line break.

Result:

• Bugger, too slow. Ah well, such is life. :D – alpenwasser May 11 '17 at 22:11