1

After I copied a TikZpicture over to another document, the nodes stopped appearing, and I got a "dimension too large" issue with the node at x=46200, furthest to the right. The xmax was 50000. I created a minimal working example (MWE) to try find the problem, but even in the MWE, the nodes now don't appear.

\documentclass[12pt, a4paper]{article}
\usepackage{amsmath, pgfplots, %(makes compiling slower)
}

\begin{document}

\begin{tikzpicture} \begin{axis}[xmax=60000, xmin=0, ymin=0] \addplot [domain=0:17712] {0.292 + 0.616/(2+x/3542.4)}; %\addplot [domain=0:17712] {0.382 - 0.38/17712x}; %\addplot [domain=17712:36000] {0.382 - 0.38/17712x}; \node [anchor=west] at (2400, 0.74) {$k(Y_i) = 0.38\times 2 - \frac{0.38}{17712}\cdot Y_i$}; %\addplot [domain=7000:17712] {0.3817712/x}; %\addplot [domain=17712:60000] {0.3817712/x}; %\addplot [domain=0:17712] { 0.6 - 0.22/17712*x}; %\addplot [domain=0:60000] {0.38}; \node [anchor=west] at (900, 0.45) {$h(Y_i)$}; \node [anchor=west] at (2000, 0.595) {$f(Y_i)$}; \node [anchor=east] at (46200 , 0.228 ) {$q(Y_i) = \frac {0.38\times 17712}{Y_i}$}; \node [anchor=south west] at (17712, 0.38) {$(17712, 0.38)$}; \end{axis} \end{tikzpicture}

\end{document}

This gives me

MWE output

The graph that I had previously was

Full graph (previously)

with this code.

ahorn
  • 673

1 Answers1

0

If you add

\pgfplotsset{compat=1.16}

to your preamble you have:

enter image description here

The reason is because at a certain version (I think 1.11), the default coordinates inside the axis environment changed from the raw TikZ ones to the user-defined ones. If you don't state you want the new state-of-things explicitly, pgfplots keep the old compatibility way.

Anyway, you should had this warning in your file:

Package pgfplots Warning: running in backwards compatibility mode 
(unsuitable tick labels; missing features). 
Consider writing \pgfplotsset{compat=1.16} into your preamble.
Rmano
  • 40,848
  • 3
  • 64
  • 125