[plotter] [postprocessor] make particles scatter actually work

This commit is contained in:
Noe Brucy
2021-01-20 15:25:30 +01:00
parent 2c1c690ba8
commit 600f3a800a
3 changed files with 14 additions and 9 deletions
+4 -3
View File
@@ -695,9 +695,10 @@ class Plotter(Aggregator, BaseProcessor):
"""
# Open particle HDF5 file
filename = self.save.get_node("/hdf5/particles").read()
hdf5_parts = tables.open(filename, "r")
filename = self.save.get_node("/hdf5/particles").read()[0].decode()
hdf5_parts = tables.open_file(filename, "r")
part_pos = hdf5_parts.get_node("/data/pos").read()
hdf5_parts.close()
# index of the horizontal axis
ih = self._ax_nb[self._axes_h[ax_los]]
@@ -713,7 +714,7 @@ class Plotter(Aggregator, BaseProcessor):
part_v = im_extent[2] + (im_extent[3] - im_extent[2]) * part_v
# Scatter plot
plt.scatter(part_h, part_v)
plt.scatter(part_h, part_v, **kwargs)
def _overlay_speed(
self, ax_los, im_extent, unit=U.km_s, unit_coeff=1.0, key_v=None, **kwargs