I found some code to asign colors to table values with PGFplotstable, but unfortunately it is only designed for tables where the topmost row is a head row (which is ignored by postproc). I also need the first column to be ignored by postproc - probably realtively simple but I just cant find how to do it.

This is the code:

    color cells/.style={
        col sep=comma,
        string type,
        postproc cell content/.code={%
                \pgfkeysalso{@cell content=\rule{0cm}{2.4ex}%
                \pgfmathsetmacro\y{min(100,max(0,abs(round(##1 * 0.5))))}%
                \ifnum\x>50 \color{white}\fi%

\begin{table}\caption{Correlation or something}
\pgfplotstabletypeset[color cells]{

(original source is: Drawing heatmaps using TikZ)

The code does not work, as the values in the first column are not numbers - i just want to ignore them, leaving those cells as they are.


1 Answer 1


Ahhh I found it, pretty simple actually: I start the tabe with the attribute 'columns/a/.style={reset styles,string type}' :

\pgfplotstabletypeset[color cells, columns/a/.style={reset styles,string type}]

Where 'a' is the name of my first column !

Hope this helps someone else ;)

  • Helped me, thanks! I thought one could do this by index (e.g. columns/1/.style=... but only found this: every first column/.style=... to work.
    – BadAtLaTeX
    Commented Apr 7, 2020 at 0:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .