양방향을 가리키는 축과 위치 지정 축 레이블(Tikz). AD-AS 다이어그램

양방향을 가리키는 축과 위치 지정 축 레이블(Tikz). AD-AS 다이어그램

이런 그래프를 재현하고 싶은데 그림처럼 축을 만드는 방법을 모르겠습니다. 방법을 아는 사람이 있나요? 양방향을 가리키는 축이 없는 비슷한 예는 다음과 같습니다.

% Author: Rasmus Pank Roulund
\documentclass{minimal}
\usepackage{tikz}
\usepackage{verbatim}

\begin{comment}
:Title: Intersection of
:Tags: Coordinate systems


This example shows how the ``intersection of`` mechanism of Tikz work. Notice how a horizontal 
line is made from point B to allow the calculation to be done.

Caption: In a fixed exchange regime it might not be possible to reach internal balance 
(full employment and price stability) and external balance (some given level of net export) 
using only fiscal policy. At point B only point C and D can be reached via fiscal policy. 
Only by devaluing the country is able to reach the optimum level at point A.

:Author: Rasmus Pank Roulund

\end{comment}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[
    scale=5,
    axis/.style={very thick, ->, >=stealth'},
    important line/.style={thick},
    dashed line/.style={dashed, thin},
    pile/.style={thick, ->, >=stealth', shorten <=2pt, shorten
    >=2pt},
    every node/.style={color=black}
    ]
    % axis
    \draw[axis] (-0.1,0)  -- (1.1,0) node(xline)[right]
        {$G\uparrow/T\downarrow$};
    \draw[axis] (0,-0.1) -- (0,1.1) node(yline)[above] {$E$};
    % Lines
    \draw[important line] (.15,.15) coordinate (A) -- (.85,.85)
        coordinate (B) node[right, text width=5em] {$Y^O$};
    \draw[important line] (.15,.85) coordinate (C) -- (.85,.15)
        coordinate (D) node[right, text width=5em] {$\mathit{NX}=x$};
    % Intersection of lines
    \fill[red] (intersection cs:
       first line={(A) -- (B)},
       second line={(C) -- (D)}) coordinate (E) circle (.4pt)
       node[above,] {$A$};
    % The E point is placed more or less randomly
    \fill[red]  (E) +(-.075cm,-.2cm) coordinate (out) circle (.4pt)
        node[below left] {$B$};
    % Line connecting out and ext balances
    \draw [pile] (out) -- (intersection of A--B and out--[shift={(0:1pt)}]out)
        coordinate (extbal);
    \fill[red] (extbal) circle (.4pt) node[above] {$C$};
    % line connecting  out and int balances
    \draw [pile] (out) -- (intersection of C--D and out--[shift={(0:1pt)}]out)
        coordinate (intbal);
    \fill[red] (intbal) circle (.4pt) node[above] {$D$};
    % line between out og all balanced out :)
    \draw[pile] (out) -- (E);
\end{tikzpicture}
\end{document}

편집: 내 현재 코드는 다음과 같습니다.

\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[
    scale=5,
    axis/.style={very thick, <->, >=stealth'},
    important line/.style={thick},
    every node/.style={color=black}
    ]
    % axis
    \draw[axis] (0.1,0)  -- (1.1,0) node(xline)[right] {$Y$};
    \draw[axis] (0,0.1) -- (0,1.1) node(yline)[above] {$\pi_s$};
    % Lines
    \draw[important line] (.15,.15) coordinate (A) -- (.85,.85)
        coordinate (B) node[right, text width=5em] {$AS$};
    \draw[important line] (.15,.85) coordinate (C) -- (.85,.15)
        coordinate (D) node[right, text width=5em] {$AD$};
\end{tikzpicture}
\end{document}

건배,

파비오 여기에 이미지 설명을 입력하세요

해결책: AD-AS 다이어그램에 관심이 있는 사람들을 위해 이것이 제가 지금까지 달성한 ​​것입니다. 나는 그것이 꽤 괜찮은 것 같아요 :

\documentclass{minimal}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[
    scale=5,
    axis/.style={very thick, <->, >=stealth'},
    important line/.style={thick},
    every node/.style={color=black}
    ]
    % axis
    \draw[axis] (0.1,0)  -- (1.1,0) node(xline)[midway,below] {$\hat{Y}$};
    \draw[axis] (0,0.1) -- (0,1.1) node(yline)[midway,left] {$  \hat{\pi}_s$};
    % Lines
    \draw[important line] (.15,.15) coordinate (A) -- (.85,.85)
        coordinate (B) node[right, text width=5em] {$AS$};
    \draw[important line] (.15,.85) coordinate (C) -- (.85,.15)
        coordinate (D) node[right, text width=5em] {$AD$};
    %shifted IS-LM diagram
    \draw[xshift=.2cm, red!52] (.15,.10) coordinate (A) -- (.85,.80)
    coordinate (B) node[right, text width=5em] {$AS'$};

    %arrows between intersections
    \draw[->, thick, black, >=stealth']
    (0.61,.59) -- (.72,.48)
    node[sloped, above, midway] {$\hat{\tau}^w_S$};
\end{tikzpicture}
\end{document}

답변1

양쪽 끝에서 화살촉을 얻으려면 <->대신을 사용하십시오 ->.

화살표 중앙 위에 라벨을 쓰려면 다음을 사용하세요.

\draw (0,0) -- (5,0) node[midway,above]{A};

midway의 별칭입니다 pos=0.5.

관련 정보