1
  • I really tried to solve this question on my own: I must have missed the obvious answer.
  • One can use \pgfplotsset{compat=x.y} to set used version of pgfplots.
  • I thought that the version that is stated on CTAN or the manual cover page is the version that I can use within \pgfplotsset{compat=x.y}.
  • But apparently, I am mistaken since the current version on CTAN is labeled 1.18.1 but I can use \pgfplotsset{compat=1.9} in my document.
  • Question: Where does a naive user (meaning: no solution that requires looking at a log file) find out what is the newest version of pgfplots without using \pgfplotsset{compat=newest} (see here).

enter image description here


Update: I was stupid and confused 1.18 with 1.1.8! Thanks to user CarLaTeX for the help!

1 Answers1

2

Run your document without \pgfplotsset{compat=...}

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot{x};
\end{axis}
\end{tikzpicture}
\end{document}

In the log you will get:

Package pgfplots Warning: running in backwards compatibility mode (unsuitable t
ick labels; missing features). Consider writing \pgfplotsset{compat=1.18} into 
your preamble.
 on input line 4.

The newest version is the one suggested in the log: \pgfplotsset{compat=1.18}.

CarLaTeX
  • 62,716
  • Thanks! This is what I used before but I needed to upgrade to 1.8 in order to use a specific feature. This is what made me wonder. – Dr. Manuel Kuehner Mar 10 '22 at 22:11
  • @Dr.ManuelKuehner Sorry, I don't understand why you don't use \pgfplotsset{compat=1.8}, then. – CarLaTeX Mar 10 '22 at 22:14
  • I want to use (explicitly select) the most current version without using the newest option, see https://tex.stackexchange.com/questions/139690/. – Dr. Manuel Kuehner Mar 10 '22 at 22:16
  • @Dr.ManuelKuehner The newest is \pgfplotsset{compat=1.18}, I have updated my TeX Live this morning. – CarLaTeX Mar 10 '22 at 22:18
  • Thanks for the effort. But why can I use 1.8 or 1.9? Isn't 1.8 > 1.18? The manual also mentioned 1.3 etc. – Dr. Manuel Kuehner Mar 10 '22 at 22:20
  • Wait a sec.-- maybe I am stupid! I confused 1.18 with 1.1.8! – Dr. Manuel Kuehner Mar 10 '22 at 22:21
  • 1
    @Dr.ManuelKuehner No, 1.8 is < 1.18 because it's not a decimal point, it's a version.subversion. Version 1 subversion 8 is less than version 1 subversion 18. – CarLaTeX Mar 10 '22 at 22:22
  • Sorry for that. The confusion was that I needed to change from 1.18 to 1.8 in order to get a simple example running and that is why I assumed that 1.8 must be newer. – Dr. Manuel Kuehner Mar 10 '22 at 22:23
  • 2
    The tikzpicture is actually not necessary in your example, the warning comes anyway. In addition, \documentclass{article} \usepackage{pgfplots} \begin{document} \pgfplotsversion \end{document} can be used to print the version number in the PDF. – Torbjørn T. Mar 10 '22 at 22:23
  • @TorbjørnT. I didn't know that, feel free to add your answer. Thank you. – CarLaTeX Mar 10 '22 at 22:25