Code:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usetikzlibrary{
pgfplots.groupplots,
matrix
}
\usepackage{siunitx}
\begin{document}
\begin{figure}[htb]
\centering
\begin{tikzpicture}
\begin{groupplot}[
group style={
group size=1 by 2,
xticklabels at=edge bottom,
vertical sep=0pt
},
legend cell align=left,
legend pos=north east,
width=0.9\textwidth,
height = 4cm,
xmin=24, xmax= 86,
extra x ticks={25,85},
]
\nextgroupplot[
ymin=25.8, ymax=27.7,
ytick={26.5,27,27.5},
axis x line*=top,
height = 4.5cm,
axis y discontinuity=crunch,
]
\addplot[blue,mark=*] plot coordinates {
(25,27.568)
(30,27.464)
(40,27.264)
(50,27.083)
(55,26.989)
(60,26.909)
(70,26.736)
(80,26.577)
(85,26.499)};\label{plots:plot1}
\coordinate (top) at (rel axis cs:0,1);
\nextgroupplot[
ymin=2.98,ymax=3.24,
axis x line*=bottom,
xlabel=Temperatur in \si{\degree}C,
height = 4cm,
]
\addplot[red,mark=triangle*,dashed] plot coordinates {
(25,3.2246)
(55,3.1092)
(85,3.0165)};\label{plots:plot2}
\coordinate (bot) at (rel axis cs:1,0);
\end{groupplot}
% y Label
\path (top-|current bounding box.west)--
node[anchor=south,rotate=90] {Vorwärtsspannung in V}
(bot-|current bounding box.west);
% Legende
\path (top|-current bounding box.north)--
coordinate(legendpos)
(bot|-current bounding box.north);
\matrix[
matrix of nodes,
anchor=south,
draw,
inner sep=0.2em,
draw
]at([yshift=1ex]legendpos)
{
\ref{plots:plot1}& Amber, Weiß&[5pt]
\ref{plots:plot2}& Weiß
\\};
\end{tikzpicture}
\label{polt:Auswertung_1_1_Amber}
\caption{Vorwärtsspannung zweier LED's in Abhängigkeit der Temperatur an dessen Rückseite.}
\end{figure}
\end{document}
Lesezeichen