1

I was trying to add arrow decoration to a curve in a three dimensional plot like following

% !TEX TS-program = xelatex
\documentclass[UTF8]{article}

\usepackage{float}

\usepackage{amssymb}

\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{arrows.meta}
\usetkzobj{all}
\usepackage{graphicx}

\begin{document}

\begin{figure}[H]
\begin{center}
\begin{tikzpicture}[smooth, decoration = {markings, mark = at position 0.4 with {\arrow{Stealth[round, scale = 1.5]}}}]
\centering
\draw[postaction = {decorate}] plot coordinates{(1, 3) (2, 4) (4, 1)};
\end{tikzpicture}
\end{center}
\end{figure}

\end{document}

The compiler will complain the following when I change the decoration position to 0.2 or any value near it

Dimension too large.

I analyzed a few cases, it seems like the compiler will complain whenever the arrow decoration position is near any of the coordination point, in our case, (2, 4).

Is there an explanation? Thanks in advance!

9
  • It has nothing to do with the specific point, but with the fact that the curvature in the neighborhood of this point is large. Very often it is possible to draw an almost identically looking curve in a different way, and the problem does not arise.
    – user121799
    Commented Oct 23, 2018 at 19:54
  • Your code compiles without error here with MikTeX
    – AndréC
    Commented Oct 23, 2018 at 19:56
  • @marmot What do you mean by drawing an almost identically looking curve?
    – zyy
    Commented Oct 23, 2018 at 19:58
  • @AndréC How did you compile? It compiles fine on my laptop. I used xelatex for compiling.
    – zyy
    Commented Oct 23, 2018 at 20:00
  • I compiled with pdflatex
    – AndréC
    Commented Oct 23, 2018 at 20:01

1 Answer 1

1

What I mean by almost identical path is that there are more harmful and harmless ways to draw very similar curves.

\documentclass[UTF8]{article}
\usepackage{float}

\usepackage{amssymb}

\usepackage{tikz}
\usetikzlibrary{decorations.markings,arrows.meta}
\usetikzlibrary{hobby}

\begin{document}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{scope}[decoration = {markings, mark = at position 0.4 with {\arrow{Stealth[round, scale = 1.5]}}}]
 \draw[postaction = {decorate}] plot[smooth] coordinates{(1, 3) (2, 4) (4, 1)};
\end{scope} 
\begin{scope}[xshift=4cm,decoration = {markings, mark = at position 0.3 with {\arrow{Stealth[round, scale = 1.5]}}}]
\draw[postaction = {decorate}] (1, 3) to[curve through={(1.4,3.6) .. (2, 4) .. 
(2.7,3.3) .. (3.1,2.5)}] (4, 1);
\end{scope}
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

I stress that I did not make too much effort in reproducing your curve. This is just to tell you that (a) yes, there can be issues and (b) they may go away if you employ alternative ways of drawing such curves.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .