How am I able to rotate the first entries of a table with pgfplotstable
? I have the following table and want to rotate the descN
labels in the first row.
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{pgfplotstable}
\pgfplotstableset{
every head row/.style={
before row=\hline,
after row=\hline\hline
},
every last row/.style={
after row=\hline
},
every first column/.style={
column type/.add={|}{}
},
every last column/.style={
column type=||l|
},
color cells/.style={
col sep=&,
row sep=\\,
string type,
postproc cell content/.code={%
\pgfkeysalso{@cell content=\rule{0cm}{2.4ex}%
\pgfmathsetmacro\y{max((##1 * 100), 0}%
\edef\temp{\noexpand\cellcolor{black!\y}}\temp%
\pgfmathtruncatemacro\x\y%
\ifnum\x>50 \color{white}\fi%
##1}%
},
columns/x/.style={
column name={},
postproc cell content/.code={}
}
}
}
\begin{document}
\begin{table}
\centering
\pgfplotstabletypeset[color cells]{
desc1 & desc2 & desc3 & desc4 & x \\
0.9 & 0.1 & 0 & 0 & desc1 \\
0 & 0.8 & 0.1 & 0.1 & desc2 \\
0 & 0 & 0.95 & 0.05 & desc3 \\
0 & 0.1 & 0.05 & 0.85 & desc3 \\
}
\end{table}
\end{document}
Best Answer
There must be another key to reach this but I can't remember it so I did it a little laborously.