0

I have used the very nice grouping macro described here:

How can I mix an "ybar" and an "ybar stacked" with pgfplots?

I would like to be able to use it with data that I have read from a file. How can that be achieved? Instead of the data table written into the tex file, I would like to have it outside, in its own file. How can I do that so that the references to \datatable in the grouping function still work?

hjb981
  • 1,387
  • See "4.2.8 Reading coordinates From Files" on page 51 of the pgfplots manual. – Luigi Oct 11 '12 at 09:53
  • I have read data from files for plots (as described in the manual), and although I have had no trouble plotting in that way, I have not been able to make the grouping function I linked to work when I read data from a file. Perhaps setting a label to the table read from a file would work, but I have not succeeded in doing that. – hjb981 Oct 11 '12 at 10:07

1 Answers1

1

Let mytable.dat be you data file, then substitute all the \pgfplotstableread environment with

\pgfplotstableread{mytable.dat}\datatable

and that's all.

Mensch
  • 65,388
Luigi
  • 6,325
  • I thought I had tried that, but I must have done something wrong earlier, because it did indeed work. – hjb981 Oct 11 '12 at 11:03