4

In my MWE (see below) the arrow from node P2 to node P3 points in the wrong direction (should be up not down).

I suspect the close proximity of these two nodes could be responsible for this issue, but I don't know how to solve it without changing the two nodes in the last line inside the tikz-picture, which is technically the "wrong" solution in my opinion.

MWE:

\documentclass{standalone}

\usepackage{tikz}
    \usetikzlibrary{arrows,%
    positioning,%
    shapes}% TIKZ Bibliotheken

\begin{document}

    \begin{tikzpicture}
        % x-Achse
        \draw [->] (-0.5,0) -- (9,0)% Linie
            node [right] {Preis};% Label
        % y-Achse
        \draw [->] (0,-0.5) -- (0,9)% Linie
            node [above] {Menge};% Label
        % Graph
        \draw (0,8) -- (3,7)% Linie 1
            node [midway, above, sloped] {Nachfrage};% Label
        \draw [teal] (3,7) -- (5,1)% Linie 2
            node [teal, midway, right] {monopolistischer Bereich};% Label
        \draw (5,1) -- (8,0);% Linie 3
        % Menge
        \draw [teal, dashed] (5,1) -- (5,0)% Linie
            node [below] (M1) {\(M_1\)};% Label
        \draw [teal, dashed] (3,7) -- (3,0)% Linie
            node [below] (M2) {\(M_2\)};% Label
        \draw [->, teal] (M1) -- (M2);
        \draw [red, dashed] (1.5,7.5) -- (1.5,0)% Linie
            node [below] (M3) {\(M_3\)};% Label
        \draw [->, red] (M2) -- (M3);
        % Preise
        \draw [teal, dashed] (5,1) -- (0,1)% Linie
            node [left] (P1) {\(P_1\)};% Label
        \draw [teal, dashed] (3,7) -- (0,7)% Linie
            node [left] (P2) {\(P_2\)};% Label
        \draw [->, teal] (P1) -- (P2);
        \draw [red, dashed] (1.5,7.5) -- (0,7.5)% Linie
            node [left] (P3) {\(P_3\)};% Label
        \draw [->, red] (P2) -- (P3);
    \end{tikzpicture}

\end{document}
``
1
  • 1
    The conjecture seems correct. Adding scale=1.5 shows a full fledged arrow in the right direction.
    – egreg
    Sep 10, 2021 at 14:25

1 Answer 1

7

The issue is that the node P3 and the node P2 overlap. So the bottom of P3 is below the top of P2. The \draw command is drawing from the top edge of P2 to the bottom edge of P3, which is downward.

You can use (P2.center) -- (P3.center) to draw from the center of the nodes, but then the arrow must be shortened using shorten >= and shorten <=. Note that the space after shorten is not optional.

I suggest

\draw [->, red, shorten >=1.5mm, shorten <=2mm] (P2.center) -- (P3.center);

but you can shorten the arrow more if you wish.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.