TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to the manual of pgfplotstable it is fairly easy to set the color of a whole row or a whole column of a table. However, I would like to style only one element located in a certain row and column.

There is \pgfplotstablegetelem{<row>}{<col>}\of{<table>} for accessing table elements.

I can style elements determined by their signs: columns/account1/.style={fonts by sign={}{\color{red}}}.

How can I style 22 in the following example identified by its row-columns-coordinates (colB,2)? This feature makes sense, if I load data from a file with plain data.

\pgfplotstabletypeset[col sep=&,row sep=\\,sci zerofill]{
  colA & colB & colC \\
  11   & 12   & 13   \\
  21   & 22   & 23   \\
share|improve this question
up vote 5 down vote accepted

pgfplotstable up to version 1.4.1 only supports row- and column styles. However, it allows to query the \pgfplotstablerow and \pgfplotstablecol macros, so you can use the (admittadly arkward) syntax

        postproc cell content/.code={%
                \pgfkeysalso{@cell content=\textbf{##1}}%
    col sep=&,row sep=\\]{
  colA & colB & colC \\
  11   & 12   & 13   \\
  21   & 22   & 23   \\

what it does it to assign a post-processor for the complete column. But the column-specific post-processor checks the row index and applies the action only for row index 1 (indexing starts at 0).

It appears as if I have forgotten this particular feature. I have just added a new feature to pgfplotstable which implements that specific application in a much simpler way (by defining a every row <index> column <name or index>/.style). If you need such a thing very often, you may want to watch for the pgfplots unstable version on the pgfplots sourceforge web page, I will upload the changes in the next days.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.