Legendeneinträge rechtsbündig anordnen
Verfasst: Mo 4. Sep 2017, 15:13
Hallo,
ich möchte zwei Graphen plotten und dafür lediglich eine Legende nutzen. Das habe ich so weit hinbekommen, siehe Minimalbeispiel. Nun möchte ich die Einträge in der Legende rechtsbündig anordnen. Wie kann ich das realisieren?
Vielen Dank im Voraus.
ich möchte zwei Graphen plotten und dafür lediglich eine Legende nutzen. Das habe ich so weit hinbekommen, siehe Minimalbeispiel. Nun möchte ich die Einträge in der Legende rechtsbündig anordnen. Wie kann ich das realisieren?
\documentclass[margin=5mm]{standalone} \usepackage{pgfplots} \usetikzlibrary{matrix,positioning} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=newest} \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} \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\\ }; \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, ]at([yshift=0ex]legendpos) { \ref{plots:plot1}& blaaaaa&[5pt] \\ \ref{plots:plot2}& blub&[5pt] \\ \ref{plots:plot3}& bla&[5pt] \\}; \end{tikzpicture} \end{document}
Vielen Dank im Voraus.