Hallo,

ich habe hier zwei Kennlinienfelder die wie in den Abbildungen beschriftet werden sollen, wie geht das?

Kennlinienfeld 1:

Open in writeLaTeX
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{intersections}
\begin{document}

      \begin{tikzpicture}[
        hilfslinie/.style = {help lines, dashed},
        funktion/.style = {black, thick, mark = none}
      ]
      \begin{axis}[
          axis y line = left,
          axis x line = bottom,
          xtick       = \empty,
          ytick       = \empty,
          samples     = 160,
          domain      = 0:5,
          xmax = 6,
          ymax = 6,
          xlabel=$I$,
          ylabel=$\Psi$
        ]
        \addplot[funktion, name path global = funktion1] {0.5*x};
        \addplot[funktion, name path global = funktion2] {1*x};
        \addplot[gray!60] fill between [
          of = funktion1 and funktion2,
          soft clip = {domain = 0:3}
        ] ;
        \path[name path = linie] (axis cs:3,0) -- (axis cs:3,4);
        \draw[hilfslinie, name intersections = {of = funktion1 and linie}]
          ({axis cs:3,0}-|intersection-1) -- (intersection-1);
        \draw[hilfslinie, name intersections = {of = funktion1 and linie}]
          ({axis cs:0,0}|-intersection-1) -- (intersection-1);
        \draw[hilfslinie, name intersections = {of = funktion2 and linie}]
          ({axis cs:0,0}|-intersection-1) -- (intersection-1);
      \end{axis}
    \end{tikzpicture}
\end{document}

Kennlinienfeld 2:

Open in writeLaTeX
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{intersections}
\begin{document}
    \begin{tikzpicture}[
        hilfslinie/.style = {help lines, dashed},
        funktion/.style = {black, thick, mark = none}
      ]
      \begin{axis}[
          axis y line = left,
          axis x line = bottom,
          xtick       = \empty,
          ytick       = \empty,
          samples     = 160,
          domain      = 0:5,
          xmax = 6,
          ymax = 6,
          xlabel=$I$,
          ylabel=$\Psi$
        ]
        \addplot[funktion, name path global = funktion1] {sqrt(x)};
        \addplot[funktion, name path global = funktion2] {2*sqrt(x)};
        \addplot[gray!60] fill between [
          of = funktion1 and funktion2,
          soft clip = {domain = 0:3}
        ] ;
        \path[name path = linie] (axis cs:3,0) -- (axis cs:3,4);
        \draw[hilfslinie, name intersections = {of = funktion1 and linie}]
          ({axis cs:3,0}-|intersection-1) -- (intersection-1);
        \draw[hilfslinie, name intersections = {of = funktion1 and linie}]
          ({axis cs:0,0}|-intersection-1) -- (intersection-1);
        \draw[hilfslinie, name intersections = {of = funktion2 and linie}]
          ({axis cs:0,0}|-intersection-1) -- (intersection-1);
      \end{axis}
    \end{tikzpicture}
\end{document}

Abbildungen:

alt text alt text


Ich habe hier, wenn auch nicht sehr elegant, mal einen Versuch gestartet:

Open in writeLaTeX
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{intersections}
\begin{document}

\begin{tikzpicture}[
    hilfslinie/.style = {help lines, dashed},
    funktion/.style = {black, thick, mark = none}
  ]
  \begin{axis}[
      axis y line = left,
      axis x line = bottom,
      xtick       = \empty,
      ytick       = \empty,
      samples     = 160,
      domain      = 0:5,
      xmax = 6,
      ymax = 6,
      xlabel=$I$,
      ylabel=$\Psi$,
      extra x ticks = {3},
      extra x tick labels = {$I_0$},
      extra y ticks = {3.46475,1.7325},
      extra y tick labels = {${x_1,\delta_1}$, ${x_2,\delta_2}$}
    ]
    \addplot[funktion, name path global = funktion2,color=black] {2*sqrt(x)};
    \addlegendentry{Case 1}
    \addplot[funktion, name path global = funktion1,color=blue] {sqrt(x)};
    \addlegendentry{Case 2}
    \addplot[gray!60] fill between [
      of = funktion1 and funktion2,
      soft clip = {domain = 0:3}
    ] ;
    \path[name path = linie] (axis cs:3,0) -- (axis cs:3,4);
    \draw[hilfslinie, name intersections = {of = funktion1 and linie}]
      ({axis cs:3,0}-|intersection-1) -- (intersection-1);
    \draw[hilfslinie, name intersections = {of = funktion1 and linie}]
      ({axis cs:0,0}|-intersection-1) -- (intersection-1);
    \draw[hilfslinie, name intersections = {of = funktion2 and linie}]
      ({axis cs:0,0}|-intersection-1) -- (intersection-1);
    \legend{$\Psi_1(I_0,\delta_1)$\\$\Psi_2(I_0,\delta_2)$\\}
  \end{axis}
\end{tikzpicture}

\end{document}

Leider bekomme ich diese Delta Psi Bemaßung zwischen den Kurven nicht hin. Desweiteren gibt es sicher eine bessere Variante für die y-Beschriftung, als die Punkte so genau zu suchen (3.46475,1.7325).

gefragt 09 Jun '14, 09:51

Patrick1990's gravatar image

Patrick1990
1143711
Akzeptiert-Rate: 0%

bearbeitet 09 Jun '14, 11:13


Hier ist mal noch eine Alternative ohne zusätzliche Bibliotheken. Für die Beschriftung der y-Achse werden die Schnittpunkte der Hilfslinien mit dieser verwendet, weshalb keine separate Berechnung notwendig ist. Die Label für die Achsen habe ich zu den Pfeilspitzen verschoben.

Open in writeLaTeX
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{intersections}
\begin{document}

\begin{tikzpicture}[
    hilfslinie/.style = {help lines, dashed},
    differenz/.style = {latex-latex,thin},
    funktion/.style = {black, thick, mark = none}
  ]
  \begin{axis}[
      axis y line = left,
      axis x line = bottom,
      xtick       = \empty,
      ytick       = \empty,
      samples     = 160,
      domain      = 0:5,
      xmax = 6,
      ymax = 6,
      xtick=3,
      xticklabels={$I_0$},
      xlabel=$I$,
      xlabel style={at={(rel axis cs:1,0)}},
      ylabel=$\Psi$,
      ylabel style={at={(rel axis cs:0,1)},rotate=-90},
    ]
    \addplot[funktion, name path global = funktion2,color=black] {2*sqrt(x)};
    \addlegendentry{Case 1}
    \addplot[funktion, name path global = funktion1,color=blue] {sqrt(x)};
    \addlegendentry{Case 2}
    \addplot[gray!60] fill between [
      of = funktion1 and funktion2,
      soft clip = {domain = 0:3}
    ] ;
    \path[name path = linie] (axis cs:3,0) -- (axis cs:3,4);
    \path[name intersections = {of = funktion1 and linie,by=p1}];
    \path[name intersections = {of = funktion2 and linie,by=p2}];
    \draw[hilfslinie]
      ({axis cs:0,0}|-p1)coordinate(yl1)--([xshift=1.5cm]p1)
      ({axis cs:0,0}|-p2)coordinate(yl2)--([xshift=1.5cm]p2)
      (axis cs:3,0)--([yshift=.5cm]p2);
    \draw[differenz]([xshift=1cm]p1)--node[right]{$\Delta\Psi$}([xshift=1cm]p2);
    \legend{$\Psi_1(I_0,\delta_1)$\\$\Psi_2(I_0,\delta_2)$\\}
  \end{axis}
  \foreach \n in {1,2}\node[left]at(yl\n){${x_\n,\delta_\n}$};
\end{tikzpicture}
\end{document}

alt text

Permanenter link

beantwortet 09 Jun '14, 13:47

esdd's gravatar image

esdd
17.7k254256
Akzeptiert-Rate: 62%

bearbeitet 12 Jun '14, 08:50

Hier ein Vorschlag für die Beschriftung der Differenz.

Ich lade die positioning library, die man eh öfter mal gebrauchen kann (für die right of Syntax), und bestimme Koordinaten delta1 und delta2 jeweils rechts vom Schnitt. Die Hilfslinien zeichne ich dann gleich durch.

Den Beschriftungspfeil mit beidseitiger Spitze zeichne ich als edge mit node als Beschriftung.

Open in writeLaTeX
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{intersections,positioning,arrows}
\begin{document}

\begin{tikzpicture}[
    hilfslinie/.style = {help lines, dashed},
    funktion/.style = {black, thick, mark = none}
  ]
  \begin{axis}[
      axis y line = left,
      axis x line = bottom,
      xtick       = \empty,
      ytick       = \empty,
      samples     = 160,
      domain      = 0:5,
      xmax = 6,
      ymax = 6,
      xlabel=$I$,
      ylabel=$\Psi$,
      extra x ticks = {3},
      extra x tick labels = {$I_0$},
      extra y ticks = {3.46475,1.7325},
      extra y tick labels = {${x_1,\delta_1}$, ${x_2,\delta_2}$}
    ]
    \addplot[funktion, name path global = funktion2,color=black] {2*sqrt(x)};
    \addlegendentry{Case 1}
    \addplot[funktion, name path global = funktion1,color=blue] {sqrt(x)};
    \addlegendentry{Case 2}
    \addplot[gray!60] fill between [
      of = funktion1 and funktion2,
      soft clip = {domain = 0:3}
    ] ;
    \path[name path = linie] (axis cs:3,0) -- (axis cs:3,4);
    \coordinate [name intersections = {of = funktion1 and linie},
      right of = intersection-1] (delta1);
    \draw[hilfslinie] ({axis cs:3,0}-|intersection-1) -- (intersection-1);
    \draw[hilfslinie] ({axis cs:0,0}|-intersection-1) -- (delta1);
    \coordinate [name intersections = {of = funktion2 and linie},
      right of = intersection-1] (delta2);
    \draw[hilfslinie] ({axis cs:0,0}|-intersection-1) -- (delta2);
    \draw (delta1) edge [thin, latex-latex] node [right] {$\Delta\Psi$} (delta2);
    \legend{$\Psi_1(I_0,\delta_1)$\\$\Psi_2(I_0,\delta_2)$\\}
  \end{axis}
\end{tikzpicture}

\end{document}

Beschriftung

Permanenter link

beantwortet 09 Jun '14, 12:10

stefan's gravatar image

stefan ♦♦
18.1k143048
Akzeptiert-Rate: 48%

Vielen Dank, habe nun alles, was ich brauche. Werde mich mal durchdenken, auf den linearen Plot konnte ich alles übertragen. Gibt es denn noch eine elegantere Lösung für diese y-Beschriftung?

(09 Jun '14, 13:05) Patrick1990
Deine Antwort
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×296
×50

gestellte Frage: 09 Jun '14, 09:51

Frage wurde gesehen: 11,668 Mal

zuletzt geändert: 12 Jun '14, 08:50