# Tikz error with ! Dimension too large

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\usepackage[utf8]{inputenc}

\usepackage{tikz,bm,color}
\usetikzlibrary{fit,arrows.meta}

\begin{document}

% with errors
\begin{tikzpicture}[scale=0.075]
\draw[-{Stealth[length=2.5mm]},thin] (-2,0)--(198,0);
\node [below] at (195,0) {\scriptsize{$Q$}};
\draw[-{Stealth[length=2.5mm]},thin] (0,-2)--(0,158);
\node [left] at (0,155) {\scriptsize{$p$}};
\draw [very thick] (0,100) -- (95,100) to [out=0,in=180] (100,100) to [out=0,in=135] (175,85);
\draw [dashed] (0,65) -- (150,65);
\draw [dash dot] (0,141) to [out=0,in=150] (100,100) to [out=330,in=135 (150,65) to [out=315,in=135] (160,55);
\end{tikzpicture}
%! Dimension too large.

% no errors
\begin{tikzpicture}[scale=0.075]
\draw[-{Stealth[length=2.5mm]},thin] (-2,0)--(198,0);
\node [below] at (195,0) {\scriptsize{$Q$}};
\draw[-{Stealth[length=2.5mm]},thin] (0,-2)--(0,158);
\node [left] at (0,155) {\scriptsize{$p$}};
\draw [very thick] (0,100) -- (95,100) -- (100,100) -- (175,85);
\draw [dashed] (0,65) -- (150,65);
\draw [very thick] (0,141) -- (100,100) -- (150,65) -- (160,55);
\end{tikzpicture}
% no errors

\end{document}


I can't figure why this is happening?

• without testing it is probably because of the scale of the arrow – percusse Aug 7 '16 at 15:24
• There is also a [ missing behind [out=330,in=135. And size commands don't take arguments, so it should be \scriptsize $p$ – samcarter_is_at_topanswers.xyz Aug 7 '16 at 15:29
• scale of the arrow is not solution @percusse – Miroslav Aug 7 '16 at 17:38
• missing ] is not solve problem, and \scripsize $p$ with removing {} nothing change @samcarter – Miroslav Aug 7 '16 at 17:42
• Well, 175cm is indeed a large dimension. The error is pretty much self-explanatory. :) – Alenanno Aug 7 '16 at 18:05

A minimal example still exhibiting the error is

\documentclass[tikz]{standalone}
\begin{document}
\tikz\draw (100,100) to [out=0,in=135] (175,85);
\end{document}


My guess is that computing the arc causes some overflow; in fact, your picture has a size in the range of one or more square meters.

Since you scale your picture by a factor of 0.075 anyway, I suggest to use a scale factor of 0.75 and reduce the numbers by a factor of 10. The command

\tikz\draw (10.0,10.0) to [out=0,in=135] (17.5,8.5);


gives no error.

Here is your modified document and the corresponding output. Seems to work.

\documentclass[convert={outext=.jpg}]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepackage[utf8]{inputenc}
\usepackage{tikz,bm,color}
\usetikzlibrary{fit,arrows.meta}
\begin{document}
\begin{tikzpicture}[scale=0.75]
\draw[-{Stealth[length=2.5mm]},thin] (-0.2,0)--(19.8,0);
\node [below] at (19.5,0) {\scriptsize{$Q$}};
\draw[-{Stealth[length=2.5mm]},thin] (0,-0.2)--(0,15.8);
\node [left] at (0,15.5) {\scriptsize{$p$}};
\draw [very thick] (0,10.0) -- (9.5,10.0) to [out=0,in=180]
(10.0,10.0) to [out=0,in=135] (17.5,8.5);
\draw [dashed] (0,6.5) -- (15.0,6.5);
\draw [dash dot] (0,14.1) to [out=0,in=150]
(10.0,10.0) to [out=330,in=135] (15.0,6.5)
to [out=315,in=135] (16.0,5.5);
\end{tikzpicture}
\end{document}


\begin{tikzpicture}[x=1.0mm,y=1.0mm]
\draw[-{Stealth[length=2.5mm]},thin] (-2,0)--(98,0);
\node [below] at (95,0) {\scriptsize{$t$}};
\draw[-{Stealth[length=2.5mm]},thin] (0,-2)--(0,78);
\node [left] at (0,75) {\scriptsize{$Q$}};
\begin{axis}
[
anchor=origin,
x=0.5mm, y=0.5mm,
hide axis,
xmin = 0, xmax = 190,
ymin = 0, ymax = 150,
]
{
(0,100)
(100,100)
(175,85)
};
{
(0,141)
(100,100)
(163,55)
};