How to use the nwbwidgets.base.fig2widget function in nwbwidgets

To help you get started, we’ve selected a few nwbwidgets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / timeseries.py View on Github external
def show_timeseries(node: TimeSeries, neurodata_vis_spec=None, istart=0, istop=None, ax=None, zero_start=False,
                    **kwargs):
    fig = show_timeseries_mpl(node, neurodata_vis_spec, istart, istop, ax, zero_start, **kwargs)

    info = []
    for key in ('description', 'comments', 'unit', 'resolution', 'conversion'):
        info.append(widgets.Text(value=repr(getattr(node, key)), description=key, disabled=True))
    children = [widgets.VBox(info)]

    children.append(fig2widget(fig))

    return widgets.HBox(children=children)
github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / image.py View on Github external
def show_image(index=0):
        fig, ax = plt.subplots(subplot_kw={'xticks': [], 'yticks': []})
        ax.imshow(image_series.data[index, :, :], cmap='gray')
        plt.show()
        return fig2widget(fig)
github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / ecephys.py View on Github external
def control_plot(spk_ind):
        fig, ax = plt.subplots(figsize=(9, 5))
        data = ses.data[spk_ind]
        if nChannels > 1:
            for ch in range(nChannels):
                ax.plot(data[:, ch], color='#d9d9d9')
        else:
            ax.plot(data[:], color='#d9d9d9')
        ax.plot(np.mean(data, axis=1), color='k')
        ax.set_xlabel('Time')
        ax.set_ylabel('Amplitude')
        plt.show()
        return fig2widget(fig)