2

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

3

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
    Bugger, too slow. Ah well, such is life. :D – alpenwasser May 11 '17 at 22:11

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.