2

Here's a MWE:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{tikzpicture}[
        ]
    \begin{axis}[
        ]
        \draw (0,0) -- (1,1);
    \end{axis}
\end{tikzpicture}
\end{document}

I'm getting an empty axis. Just like in this previous question. However, as you can see, I do specify a new enough compatible version.

YMA
  • 195

1 Answers1

1

The philosophy of pgfplots is that it will adjust the axes to efficiently show the plots that you draw. If you do not (want to) draw plots, you can still set xmin etc. to get an non-empty plot. Needless to say that this does, at least to some extent, defeat the purpose of pgfplots, but if you're doing this to get labelled axes with little effort then that's of course fine.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{tikzpicture}[]
    \begin{axis}[xmin=0,xmax=1,ymin=0,ymax=1]
        \draw (0,0) -- (1,1);
    \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

  • Perfect. Thank you. Also, I understand the reasoning, so thanks for that as well. – YMA Oct 16 '18 at 06:47