TikZ 초보자: 쉬운 그래프를 멋지게 복제하기

TikZ 초보자: 쉬운 그래프를 멋지게 복제하기

이것은 내 첫 번째 플롯이고 30분 동안 Google에 검색을 시도했지만 이 그래프를 복제하려는 시도를 수정하는 방법을 알 수 없었습니다. 누군가 나를 도와줄 수 있나요?

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

이것이 내가 얻은 것입니다:

지금까지의 오류:

  1. 포물선 (2,2)노드[pos=0.8, right=10pt] {erfahren}; 위치 지정이 작동하지 않습니다. 어쨌든 비유가 잘못되었습니다.
  2. -((x-2)^2)+2와 같은 비유를 그리는 방법을 찾을 수 없습니다.

미리 감사드립니다!

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}

     \draw (0,0) -- (5,0) node[pos=0.5,below=14pt] {Zeit$\rightarrow$};
     \draw (0,0) -- (0,3) node[pos=0.5, left=10pt][text width=2cm]{$\uparrow$\\Emotionale\\Insensität};

     \draw (0,0) parabola (2,2)node[pos=0.8, right=10pt] {erfahren};
     \draw[dashed] (0,0) parabola (3,2)node[pos=0.5, right=10pt] {vorhergesagt};

\end{tikzpicture}
\end{document}

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

답변1

약간의 TikZ를 사용하면:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
    % Time axis
    \draw (0,0) -- node[below=1cm] {Time $\to$} (6,0);
    % Emotional axis
    \draw (0,0) -- node[left] {\parbox{2cm}{\centering $\uparrow$ \\ Emotional \\ intensity}} (0,4);
    % Time ticks
    \foreach \x [count=\j] in {0.2,3,4.5,6} {
        \draw (\x,0) coordinate (t\j) -- (\x,-0.1cm) node[below] (tt\j) {Time \j};
    }
    \node[below] at (tt1.south) {(Emotional event)};
    % Curves
    \draw (t1) .. controls +(1,2) .. node[above right] {Experienced} (t2);
    \draw[dashed] (t1) .. controls +(1,4) .. node[above right] {Predicted} (t4);
\end{tikzpicture}
\end{document}

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

관련 정보