1

If I set ymax in the second axis TeX give me a Dimension too large Error and I dont know why Does anybody see the mistake?

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{float}
\begin{document}
\begin{center}

        \begin{figure}[H]
        \caption{Gemessene Berschleunigung auf gerader und schräger Fläche}
        \label{num1}
            \centering
            \begin{tikzpicture}[baseline=(current axis.south)]
                \begin{axis}[grid = major,width=0.8\textwidth,height=0.35\textheight,
                    x tick label style={/pgf/number format/1000 sep=},
                    xlabel={Zeit $t$ $[s]$},ymax=850,
                    y tick label style={/pgf/number format/1000 sep=},
                    ylabel={Berschleunigung $a$ $[\frac{m}{s^2}]$},
                    axis y line=left,
                    enlarge x limits=0.01,xtick=\empty,
                    legend pos=north west]
                    \addplot [blue,solid,mark options={solid}] table[x=t, y=f,col sep=semicolon] {Mappe1.csv};
                    \label{f}
                    \addlegendentry{$f$}
                \end{axis}
                        \begin{axis}[ymin=0, ymax=1.2,width=0.8\textwidth,height=0.35\textheight,
                    x tick label style={/pgf/number format/1000 sep=},
                    xlabel={Zeit $t$ $[s]$},
                    y tick label style={/pgf/number format/1000 sep=},
                    ylabel={Berschleunigung $a$ $[\frac{m}{s^2}]$},
                    axis y line=right,
                    enlarge x limits=0.01,
                    legend pos=north west]
                    \addlegendimage{/pgfplots/refstyle=f}\addlegendentry{$f$}
                    \addplot [red,solid,mark options={solid}] table[x=t, y=Schub,col sep=semicolon] {Mappe1.csv};
                    \addlegendentry{Schub}
                \end{axis}
            \end{tikzpicture}
        \end{figure}
        \end{center}
\end{document}
dexteritas
  • 9,161
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Moriambar Jun 12 '17 at 20:44
  • 2
    Still no compilable MWE. You may use filecontent for including Mappe1.csv. It may also be sufficient to replace the addplot table command by something like\addplot [red,solid,mark options={solid}] coordinates {(0,0) (1,850)};. Do you want to make two y-axis? Then have look at pgfplots: two y-axis with three plots and one legend. – hzhr Jun 12 '17 at 21:35
  • But I think the including Mappe1 function could be a part of my problem. Its not about the two y axis. Its only about the ymax. And for some reason ymax in the second axis leads too a "Dimension too large" error – Alex Heintz Jun 13 '17 at 05:44
  • 1
    We still need your .csv data. You see here how the filecontent package is used. Without MWE (compilable), thats represent your problem, is hard to help. – Bobyandbob Jun 15 '17 at 19:03
  • 1
    Old question this I know. As others have indicated, this may not be possible to properly diagnose and answer without your data, or a subsample of it that reproduces the problem. If I plot rnd instead of your data, the code works perfectly fine. For that reason I'm going to vote to close as unclear, but I'll be sure to vote to reopen if needed. (I'll note also that many others have encountered that error, probably in various cases. In case you haven't looked at any of these yet, perhaps some hints can be found: https://tex.stackexchange.com/search?q=%5Bpgfplots%5D+dimension+too+large) – Torbjørn T. Aug 14 '17 at 20:25

0 Answers0