Closed rgeneaux closed 1 year ago
Well indeed I refactored some time ago the viewer2D (and it will also be modified with version 4...as I'm working on a broad and general way to treat data and axes in pymodaq) Anyway in your case if you look at the x_axis property of the Viewer2D (so viewer in your case: viewer = self.dashboard.scan_module.ui.scan2D_graph)
This property returns an AxisItem_Scaled scaled
then this object has a number of properties and methods to be used for your purpose:
that should do it!
Indeed this should work, thanks! the last thing I'm missing: how do you get the number of points of an axis?
the axis does not have this info but your data does via its shape! if data is the ndarray you want to plot:
Nyaxis = data.shape[0] Nxaxis = data.shape[1]
Seb
Got it, thanks!
Hi! When launched from a dashboard, the retriever has a function to "load last scan". It looks for the current "scan2D_graph" associated with the last scan performed by daq_scan, gets axis and data from it, and loads it into the retriever directly.
It now seems to be broken:
The issue is that in
data=viewer.x_axis_scaled.copy()
, the viewer doesn't have ax_axis_scaled
anymore.I was able to get the label and units using
viewer.x_axis.axis_units()
andviewer.x_axis.axis_label()
but I can't figure out how to get the data. Thanks for any help!