Normally when one wishes to to plot some data from a file (.txt, .csv or the like), one would do something like

        \addplot table {data.txt};

and get something like enter image description here

Now, if instead my data was in a hdf5 file (say data.h5) with the x and y data in the fields /xdata and /ydata respectivly, is there any way for me to get the data out from LaTeX, or do i need a third party thing (like a script) to repackage the data?

Here data.txt was:

1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
  • A.h5 could hypothetically be anywhere in the real or unreal universe, it is a structure that is reputedly best accessed through h5py which states "You’ll need HDF5 installed, which can be a pain". IS there a reason you need some h5 output that is not in CSV or other two column export / expert ? format. – KJO Jan 10 at 15:20
  • Simply opening a.H5 could as with any portable document format like PDF contain any thing from textual columns or a a graph through media etc here starts an image.h5 ‰HDF ÿÿmÿÿˆ¨ˆ¨TREEÿÿÿÿ0HEAPX0Èimage8bitpaletteimage24bitpixel( (,,xXÀÔ™sN (CLASSIMAGE 0IMAGE_VERSION1.2SNOD ( ÐàH 8IMAGE_SUBCLASSIMAGE_INDEXED( Ý™sN (CLASSPALETTE 0 PAL_VERSION1.2 (PALETTEÐ 8•ã•ã}l˜ à]Œ™sN (CLASSIMAGE 0IMAGE_VERSION1.2 – KJO Jan 10 at 15:36
  • 2
    There is a Lua-library for reading HDF5 (colberg.org/lua-hdf5), perhaps you could use that with LuaTeX to access the data. – Torbjørn T. Jan 10 at 17:03
  • @KJO, The only reason is to skip conversion between the formats (so lazyness). And because it would be cool ;-) – Thorbjørn E. K. Christensen Jan 10 at 17:10
  • @TorbjørnT. Cool sstuff ;-) – Thorbjørn E. K. Christensen Jan 10 at 17:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.