Ejemplo n.º 1
0
    def bqplot_data(self,
                    xdata,
                    ydata,
                    *,
                    xheader=None,
                    yheader=None,
                    xlabel=None,
                    ylabel=None,
                    left=None,
                    right=None,
                    ymin=None,
                    ymax=None,
                    legend=True,
                    grid=False,
                    fig=None,
                    latex=True,
                    dpi=150,
                    line_width=1.0,
                    greyscale=False,
                    savefig=None,
                    save_format=None,
                    title=None,
                    **kwargs):
        """
        Plot with ``bqplot``. Experimental and incomplete.
        """

        from bqplot import pyplot as plt
        if not isinstance(ydata, np.ndarray):
            raise TypeError(
                "ydata must be numpy array. Retrieve with `get_values()`.")

        if ydata.ndim == 1:
            ydata = ydata.reshape((-1, 1))

        if fig is None:
            fig = plt.figure(dpi=dpi)
        plt.plot(
            xdata,
            ydata.transpose(),
            linewidth=line_width,
            figure=fig,
        )

        if yheader:
            plt.label(yheader)
        if title:
            plt.title(title)
        plt.show()

        return fig
Ejemplo n.º 2
0
    def bqplot_data(self,
                    xdata,
                    ydata,
                    xheader=None,
                    yheader=None,
                    xlabel=None,
                    ylabel=None,
                    left=None,
                    right=None,
                    ymin=None,
                    ymax=None,
                    legend=True,
                    grid=False,
                    fig=None,
                    latex=True,
                    dpi=150,
                    greyscale=False,
                    savefig=None,
                    show=True,
                    **kwargs):
        """
        Plot with ``bqplot``. Experimental and imcomplete.
        """

        from bqplot import pyplot as plt
        if not isinstance(ydata, np.ndarray):
            TypeError("ydata must be numpy array. Retrieve with get_values().")

        if ydata.ndim == 1:
            ydata = ydata.reshape((-1, 1))

        plt.figure(dpi=dpi)
        plt.plot(
            xdata,
            ydata.transpose(),
            linewidth=1.5,
        )

        if yheader:
            plt.label(yheader)

        plt.show()