Plotting surface displacement magma-2d example- help with output files

I want to plot the vertical displacement at the surface (the positive y boundary) at the end of the simulation. Based on the nomenclature and the pylith visualization I believe that data is stored here: step01_inflation-bc_ypos.h5 and step01_inflation-bc_ypos.xmf. Is this correct? What is the best way to extract the information I’m looking for?

I am new to working with hdf5 files. I’ve gotten as far as locating what I believe is the data I want in matlab using

h5disp(‘step01_inflation-bc_ypos.h5’)

data=h5read(“step01_inflation-bc_ypos.h5”,“/vertex_fields/displacement”)

However, I am unsure which rows/columns correspond the the information I’m looking for. Or if I’m even looking in the right place. Please advise.

The PyLith User Guide provides a general description of the HDF5 format.

You will need the geometry/vertces array to get the coordinates of the points. The second dimension of the displacement array matches the order of the vertices. So geometry/vertices[i,:] are the coordinates of vertex i. The corresponding displacements are at displacement[:,i,:]. displacement[i,j,k] gives component k (0=x, 1=y, 2=z) displacement of vertex j at time step i.