def test_2d_pcolors(self):
     fig, ax = plt.subplots()
     funcs.pcolor(ax, self.ws2d_histo_rag)
     funcs.tripcolor(ax, self.ws2d_histo, vmin=0)
     funcs.pcolormesh(ax, self.ws_MD_2d)
     funcs.pcolorfast(ax, self.ws2d_point_uneven, vmin=-1)
     funcs.imshow(ax, self.ws2d_histo)
Beispiel #2
0
 def test_2d_pcolors(self):
     fig, ax = plt.subplots()
     funcs.pcolor(ax, self.ws2d_histo_rag)
     funcs.tripcolor(ax, self.ws2d_histo, vmin=0)
     funcs.pcolormesh(ax, self.ws_MD_2d)
     funcs.pcolorfast(ax, self.ws2d_point_uneven, vmin=-1)
     funcs.imshow(ax, self.ws2d_histo)
Beispiel #3
0
    def imshow(self, *args, **kwargs):
        """
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
        or it can be used to plot :class:`mantid.api.MatrixWorkspace`
        or :class:`mantid.api.IMDHistoWorkspace`. You can have something like::

            import matplotlib.pyplot as plt
            from mantid import plots

            ...

            fig, ax = plt.subplots(subplot_kw={'projection':'mantid'})
            ax.imshow(workspace) #for workspaces
            ax.imshow(C)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions.imshow`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions')

            def _update_data(artists, workspace):
                return self._redraw_colorplot(plotfunctions.imshow,
                                              artists, workspace, **kwargs)
            workspace = args[0]
            return self.track_workspace_artist(workspace,
                                               plotfunctions.imshow(self, *args, **kwargs),
                                               _update_data)
        else:
            return Axes.imshow(self, *args, **kwargs)
Beispiel #4
0
    def imshow(self, *args, **kwargs):
        """
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.imshow` for arrays,
        or it can be used to plot :class:`mantid.api.MatrixWorkspace`
        or :class:`mantid.api.IMDHistoWorkspace`. You can have something like::

            import matplotlib.pyplot as plt
            from mantid import plots

            ...

            fig, ax = plt.subplots(subplot_kw={'projection':'mantid'})
            ax.imshow(workspace) #for workspaces
            ax.imshow(C)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions.imshow`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions')

            def _update_data(artists, workspace):
                return self._redraw_colorplot(plotfunctions.imshow, artists,
                                              workspace, **kwargs)

            workspace = args[0]
            return self.track_workspace_artist(
                workspace, plotfunctions.imshow(self, *args, **kwargs),
                _update_data)
        else:
            return Axes.imshow(self, *args, **kwargs)