von kannstmasehn » Mo 4. Sep 2017, 15:48
Danke dir. Funktioniert bei zwei Spalten leider nur für die erste. Wie kann ich das auch bei der zweiten, bzw. bei einer dritten oder allen Spalten umsetzen? Zumal da noch hinzukommt, dass der Legendeneintrag nicht mehr auf der gleichen Höhe wie das Legendensymbol ist.
\documentclass[margin=5mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{matrix,positioning}
\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=newest}
%\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[group style={group size= 2 by 1}]
\nextgroupplot
\addplot table[row sep=crcr]{%
50 1.08606985986195\\
69.7 1.0301192219201\\
}; \label{plots:plot1}
\addplot table[row sep=crcr]{%
50 15.3733528550512\\
69.7 11.8045387994143\\
}; \label{plots:plot2}
\addplot table[row sep=crcr]{%
50 69.2846684793976\\
69.7 53.5975737293453\\
}; \label{plots:plot3}
\addplot table[row sep=crcr]{%
50 90\\
69.7 70\\
}; \label{plots:plot4}
\coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot
\nextgroupplot
\addplot table[row sep=crcr]{%
50 1.20572658060245\\
69.7 1.09731876861966\\
};
\addplot table[row sep=crcr]{%
50 23.1876861966236\\
69.7 17.9245283018868\\
};
\addplot table[row sep=crcr]{%
50 110.228401191658\\
69.7 84.5746441575637\\
};
\addplot table[row sep=crcr]{%
50 90\\
69.7 70\\
};
\coordinate (bot) at (rel axis cs:1,0);% coordinate at bottom of the last plot
\end{groupplot}
\path (top|-current bounding box.south)--
coordinate(legendpos)
(bot|-current bounding box.south);
\matrix[
matrix of nodes,
draw,
column 2/.style={anchor=east},
]at([yshift=-5ex]legendpos)
{
\ref{plots:plot1}& blaaaaa&[5pt]
\ref{plots:plot2}& blaaaaa&[5pt] \\
\ref{plots:plot3}& blub&[5pt]
\ref{plots:plot4}& blub&[5pt]
\\};
\end{tikzpicture}
\end{document}
Danke dir!
Danke dir. Funktioniert bei zwei Spalten leider nur für die erste. Wie kann ich das auch bei der zweiten, bzw. bei einer dritten oder allen Spalten umsetzen? Zumal da noch hinzukommt, dass der Legendeneintrag nicht mehr auf der gleichen Höhe wie das Legendensymbol ist.
[code]
\documentclass[margin=5mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{matrix,positioning}
\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=newest}
%\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[group style={group size= 2 by 1}]
\nextgroupplot
\addplot table[row sep=crcr]{%
50 1.08606985986195\\
69.7 1.0301192219201\\
}; \label{plots:plot1}
\addplot table[row sep=crcr]{%
50 15.3733528550512\\
69.7 11.8045387994143\\
}; \label{plots:plot2}
\addplot table[row sep=crcr]{%
50 69.2846684793976\\
69.7 53.5975737293453\\
}; \label{plots:plot3}
\addplot table[row sep=crcr]{%
50 90\\
69.7 70\\
}; \label{plots:plot4}
\coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot
\nextgroupplot
\addplot table[row sep=crcr]{%
50 1.20572658060245\\
69.7 1.09731876861966\\
};
\addplot table[row sep=crcr]{%
50 23.1876861966236\\
69.7 17.9245283018868\\
};
\addplot table[row sep=crcr]{%
50 110.228401191658\\
69.7 84.5746441575637\\
};
\addplot table[row sep=crcr]{%
50 90\\
69.7 70\\
};
\coordinate (bot) at (rel axis cs:1,0);% coordinate at bottom of the last plot
\end{groupplot}
\path (top|-current bounding box.south)--
coordinate(legendpos)
(bot|-current bounding box.south);
\matrix[
matrix of nodes,
draw,
column 2/.style={anchor=east},
]at([yshift=-5ex]legendpos)
{
\ref{plots:plot1}& blaaaaa&[5pt]
\ref{plots:plot2}& blaaaaa&[5pt] \\
\ref{plots:plot3}& blub&[5pt]
\ref{plots:plot4}& blub&[5pt]
\\};
\end{tikzpicture}
\end{document}
[/code]
Danke dir!