コード例 #1
0
ファイル: lp_discr.py プロジェクト: wjp/odl
    def show(self, method='', title='', indices=None, **kwargs):
        """Create a figure displaying the function in 1d or 2d.

        Parameters
        ----------
        method : `str`, optional
            1d methods:

        'plot' : graph plot

        2d methods:

        'imshow' : image plot with coloring according to value,
        including a colorbar.

        'scatter' : cloud of scattered 3d points
        (3rd axis <-> value)

        indices : index expression
            Display a slice of the array instead of the full array.
            The index expression is most easily created with the
            `numpy.s_` constructur, i.e. supply ``np.s_[:, 1, :]``
            to display the first slice along the second axis.

        title : `str`, optional
            Set the title of the figure
        kwargs : {'figsize', 'saveto', ...}
            Extra keyword arguments passed on to display method
            See the Matplotlib functions for documentation of extra
            options.

        title : `str`, optional
            Set the title of the figure
        kwargs : {'figsize', 'saveto', ...}
            Extra keyword arguments passed on to display method
            See the Matplotlib functions for documentation of extra
            options.

        See Also
        --------
        matplotlib.pyplot.plot : Show graph plot

        matplotlib.pyplot.imshow : Show data as image

        matplotlib.pyplot.scatter : Show scattered 3d points
        """

        from odl.util.graphics import show_discrete_function
        show_discrete_function(self, method=method, title=title,
                               indices=indices, **kwargs)
コード例 #2
0
ファイル: lp_discr.py プロジェクト: iceseismic/odl
    def show(self, method='', title='', indices=None,
             show=False, fig=None, **kwargs):
        """Display the function graphically.

        Parameters
        ----------
        method : `str`, optional
            1d methods:

            'plot' : graph plot

            2d methods:

            'imshow' : image plot with coloring according to value,
            including a colorbar.

            'scatter' : cloud of scattered 3d points
            (3rd axis <-> value)

        indices : index expression
            Display a slice of the array instead of the full array.
            The index expression is most easily created with the
            `numpy.s_` constructur, i.e. supply ``np.s_[:, 1, :]``
            to display the first slice along the second axis.

        title : `str`, optional
            Set the title of the figure

        show : `bool`, optional
            If the plot should be showed now or deferred until later.

        fig : ``matplotlib`` figure
            The figure to show in. Expected to be of same "style", as
            the figure given by this function. The most common use case
            is that ``fig`` is the return value from an earlier call to
            this function.

        kwargs : {'figsize', 'saveto', ...}
            Extra keyword arguments passed on to display method
            See the Matplotlib functions for documentation of extra
            options.

        Returns
        -------
        fig : ``matplotlib`` figure
            The resulting figure. It is also shown to the user.

        See Also
        --------
        matplotlib.pyplot.plot : Show graph plot

        matplotlib.pyplot.imshow : Show data as image

        matplotlib.pyplot.scatter : Show scattered 3d points
        """

        from odl.util.graphics import show_discrete_function
        return show_discrete_function(self, method=method, title=title,
                                      indices=indices, show=show, fig=fig,
                                      **kwargs)
コード例 #3
0
ファイル: lp_discr.py プロジェクト: LarsWestergren/odl
        def show(self, method='', title='', **kwargs):
            """Create a figure displaying the function in 1d or 2d.

            Parameters
            ----------
            method : `str`, optional
                1d methods:

                'plot' : graph plot

                2d methods:

                'imshow' : image plot with coloring according to value,
                including a colorbar.

                'scatter' : cloud of scattered 3d points
                (3rd axis <-> value)

                'wireframe', 'plot_wireframe' : surface plot

            title : `str`, optional
                Set the title of the figure
            kwargs : {'figsize', 'saveto', ...}
                Extra keyword arguments passed on to display method
                See the Matplotlib functions for documentation of extra
                options.

            See Also
            --------
            matplotlib.pyplot.plot : Show graph plot

            matplotlib.pyplot.imshow : Show data as image

            matplotlib.pyplot.scatter : Show scattered 3d points
            """

            from odl.util.graphics import show_discrete_function
            show_discrete_function(self, method=method, title=title,
                                   **kwargs)