-
Notifications
You must be signed in to change notification settings - Fork 0
02. Plottings
Jane Ling edited this page Aug 9, 2023
·
8 revisions
Visualisation of results involves two steps, first defining the plot and then showing the plot.
# initialize plot
s2p.create_fig(plottype)
# plot and save figures
s2p.plot_fig()Predefined plot types included the followings
| plottype | Description |
|---|---|
'avg_bin' |
plots the registered binary data averaged over time |
'user_defined' |
plots the selected cells in peak delta F over F intensity |
'contour' |
plots the selected cells with their contours after morphological operations |
'axis' |
plots the selected cells with their contours and axes after morphological operations |
The argument plot is a bool that tells whether to show plot or not. The default value is True.
The argument filename is a str containing the filename of figure to save. If filename is not set, the figure will NOT be saved.
If you would like to plot more than one figure, you should define all the plots before calling plot_fig()
# initialize plot average fluorescence
s2p.create_fig('avg_bin', plot=True, filename='average_binary.tif')
# initialize plot for selected cells at peak intensity
s2p.create_fig('user_defined', plot=True, filename='selected_cells.tif')
# initialize plot for selected cells with contours
s2p.create_fig('contour', plot=True, filename='contours.tif')
# initialize plot for selected cells with contours and major and minor axes
s2p.create_fig('axis', plot=True, filename='axes.tif')
# plot and save figures
s2p.plot_fig()
The above lines should give figures like this:
