3

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:

enter image description here

2

2 Answers 2

4

Adjust the axis-options. You can add:

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

The second option removes the ticks too.

2

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:

result

1
  • 1
    Bugger, too slow. Ah well, such is life. :D Commented May 11, 2017 at 22:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .