Python Forum
[solved] Save a matplotlib figure into hdf5 file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] Save a matplotlib figure into hdf5 file
#1
Hi

I've tried several methods to save directly a figure from Matplotlib into a hdf5 file, but Hdfview cannot open the file ("error opening file"): does somebody know the good way?

The last trial I did where "fig" is the object coming from Matplotlib:

FigArray = np.array(canvas.renderer.buffer_rgba(), dtype=np.uint8)
h5 = h5py.File('picture.h5', 'w')
ImageGroup = h5.require_group('Pictures')
ImageDataset = ImageGroup .create_dataset(name='picture', data=FigArray)
Thanks for your help
Reply


Messages In This Thread
[solved] Save a matplotlib figure into hdf5 file - by paul18fr - Jun-08-2021, 05:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [solved] how to speed-up huge data in an ascii file ? paul18fr 4 1,300 May-16-2023, 08:36 PM
Last Post: paul18fr
  Accessing details of chunks in HDF5 file Robotguy 0 1,592 Aug-29-2020, 06:51 AM
Last Post: Robotguy
  Fastest way to subtract elements of datasets of HDF5 file? Robotguy 3 2,710 Aug-01-2020, 11:48 PM
Last Post: scidam
  How to sort a HDF5 file Robotguy 1 3,119 Jul-23-2020, 05:34 PM
Last Post: DeaD_EyE
  Corrupted numpy arrays when save to file. DreamingInsanity 2 3,292 Dec-14-2019, 12:12 PM
Last Post: DreamingInsanity
  save my sensor data from the bme680 into a json or csv file Plastefuchs84 1 3,175 Aug-23-2019, 03:04 AM
Last Post: Plastefuchs84
  Is there a way to save a CSV file as a python object amjass12 4 2,808 Jul-16-2019, 12:00 PM
Last Post: amjass12
  save 2d array to file and load back ian 3 18,378 May-18-2018, 05:00 AM
Last Post: scidam
  matplotlib help with reading values from CSV file cps13 6 7,364 Aug-22-2017, 10:21 AM
Last Post: andre

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020