Zellenbedingte Formatierung, Einbindung von booktabs und

Tabellen und Grafiken erstellen und anordnen


die_nase
Forum-Fortgeschrittener
Forum-Fortgeschrittener
Beiträge: 50
Registriert: So 3. Mai 2015, 21:05

Zellenbedingte Formatierung, Einbindung von booktabs und

Beitrag von die_nase »

Hallo zusammen,

ich bin gerade dabei eine Tabelle mithilfe von pgfplotstable zu erstellen. Ich würde gerne eine bedingte Formatierung für die einzelnen Zellen (bzw. Spalten) vorgeben. In dem Manual stand folgende Lösung:
columns/account1/.style={fonts by sign={\color{green}}{\color{red}}}
Das gilt allerdings nur für positive und negative Werte. Wie kann ich eine Formatierung festlegen für z.B. alle Zellen einer Spalte, die <400 oder =100 sind?

Weiterhin würde ich gerne booktabs verwenden, also horizontale Linien.

Bisher habe ich folgenden Code:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfcalendar}
\usepackage{booktabs}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.13}

\begin{filecontents}{accounts.dat} 
account1 account2 account3
60 1200 400
120 1600 -410
-10 1600 410
1800 -500 410
2300 500 410
800 -192 100
\end{filecontents} 

\begin{document}
\pgfplotstabletypeset[
columns={account1, account2, account3},
column type=r,
columns/account1/.style={fonts by sign={\color{green}}{\color{red}}}
]{accounts.dat}

\vspace{5cm}

\begin{tabular}{rrr} 
\toprule
account1 & account2 & account3\\ 
\midrule 
60 & 1200 & 400		\\
120 & 1600 & -410	\\
-10 & 1600 & 410 	\\
1800 & -500 & 410	\\
2300 & 500 & 410		\\
800 & -192 & 100 	\\
\bottomrule
\end{tabular}

\end{document}
Könnt ihr mir vielleicht helfen oder mir einen Hinweis geben?

Viele Grüße

Bartman
Forum-Meister
Forum-Meister
Beiträge: 2466
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Re: Zellenbedingte Formatierung, Einbindung von booktabs und

Beitrag von Bartman »

die_nase hat geschrieben:Weiterhin würde ich gerne booktabs verwenden, also horizontale Linien.
Abschnitt 2.1 auf Seite 4 der Dokumentation von pgfplotstable.
every head row/.style={before row=\toprule,after row=\midrule},
every last row/.style={after row=\bottomrule}

die_nase
Forum-Fortgeschrittener
Forum-Fortgeschrittener
Beiträge: 50
Registriert: So 3. Mai 2015, 21:05

Beitrag von die_nase »

Hallo Bartman,

oh super, vielen Dank für deine Antwort!

Hat jemand noch einen Tipp bzgl. der bedingten Formatierung?

die_nase
Forum-Fortgeschrittener
Forum-Fortgeschrittener
Beiträge: 50
Registriert: So 3. Mai 2015, 21:05

Beitrag von die_nase »

..oder kann mir jemand einen Tipp/Ansatz geben?

Bartman
Forum-Meister
Forum-Meister
Beiträge: 2466
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Beitrag von Bartman »


die_nase
Forum-Fortgeschrittener
Forum-Fortgeschrittener
Beiträge: 50
Registriert: So 3. Mai 2015, 21:05

Beitrag von die_nase »

Danke! :)

Antworten