bisher konnte ich alle meine Fragen mit Hilfe von manuals, Forenbeiträgen oder durch simples Trial & Error beantworten, aber jetzt stehe ich doch vor einem mir unlösbarem Problem.
Ich möchte mehrere Boxplots aus verschiedenen .csv-Dateien in einer Achse darstellen, was auch problemlos funktioniert.
Das Problem: Die Boxplots haben alle die gleiche Farbe und sind deshalb nicht unterscheidbar. Ich möchte nun idealerweise die Boxplots mit verschiedenen Graustufen "füllen". Die Boxplots einer .csv-Datei sollen dabei die gleiche Füllung erhalten.
Nun habe ich ein \pgfplotsset, in dem die Einstellung für die Boxplots vorgenommen werden (nicht von mir geschrieben).
Ist es überhaupt möglich in meinem Code die Boxplots von abc.csv in einer anderen Farbe/Füllung darzustellen als die von xyz.csv?
Hier mein Code (minimaler ging leider nicht)
\begin{filecontents}{abc.csv} index;median;box_top;box_bottom;whisker_top;whisker_bottom 0;121.5;126;111.75;129;106 1;122.5;126;115.25;131;105 2;124.5;130;121.5;135;105 \end{filecontents} \begin{filecontents}{xyz.csv} index;median;box_top;box_bottom;whisker_top;whisker_bottom 0;172.5;176.75;164.25;159;180 1;172.5;174;172;162;181 2;175.5;178.75;169;165;189 \end{filecontents} \documentclass{scrreprt} \usepackage{pgfplotstable} \usetikzlibrary{pgfplots.statistics} \pgfplotsset{compat=newest} \begin{document} \pgfplotsset{ box plot/.style={ /pgfplots/.cd, black, only marks, mark=-, mark size=1em, /pgfplots/error bars/.cd, y dir=plus, y explicit, }, box plot box/.style={ /pgfplots/error bars/draw error bar/.code 2 args={% \draw ##1 -- ++(1em,0pt) |- ##2 -- ++(-1em,0pt) |- ##1 -- cycle; }, /pgfplots/table/.cd, y index=2, y error expr={\thisrowno{3}-\thisrowno{2}}, /pgfplots/box plot }, box plot top whisker/.style={ /pgfplots/error bars/draw error bar/.code 2 args={% \pgfkeysgetvalue{/pgfplots/error bars/error mark}% {\pgfplotserrorbarsmark}% \pgfkeysgetvalue{/pgfplots/error bars/error mark options}% {\pgfplotserrorbarsmarkopts}% \path ##1 -- ##2; }, /pgfplots/table/.cd, y index=4, y error expr={\thisrowno{2}-\thisrowno{4}}, /pgfplots/box plot }, box plot bottom whisker/.style={ /pgfplots/error bars/draw error bar/.code 2 args={% \pgfkeysgetvalue{/pgfplots/error bars/error mark}% {\pgfplotserrorbarsmark}% \pgfkeysgetvalue{/pgfplots/error bars/error mark options}% {\pgfplotserrorbarsmarkopts}% \path ##1 -- ##2; }, /pgfplots/table/.cd, y index=5, y error expr={\thisrowno{3}-\thisrowno{5}}, /pgfplots/box plot }, box plot median/.style={ /pgfplots/box plot } } \begin{figure} \pgfplotstableread [col sep=semicolon]{abc.csv} {\abc} \pgfplotstableread[col sep=semicolon] {xyz.csv} {\xyz} \begin{tikzpicture} \begin{axis} \addplot [box plot median] table [col sep=semicolon]{\abc}; \addplot [box plot box] table [col sep=semicolon]{\abc}; \addplot [box plot top whisker] table [col sep=semicolon]{\abc}; \addplot [box plot bottom whisker] table [col sep=semicolon]{\abc}; \addplot [box plot median] table [col sep=semicolon]{\xyz}; \addplot [box plot box] table [col sep=semicolon]{\xyz}; \addplot [box plot top whisker] table [col sep=semicolon] {\xyz}; \addplot [box plot bottom whisker] table [col sep=semicolon]{\xyz}; \end{axis} \end{tikzpicture} \end{figure} \end{document}