Ejemplo n.º 1
0
 def test_2d_contours(self):
     fig, ax = plt.subplots()
     funcs.contour(ax, self.ws2d_histo_rag)
     funcs.contourf(ax, self.ws2d_histo, vmin=0)
     funcs.tricontour(ax, self.ws_MD_2d)
     funcs.tricontourf(ax, self.ws_MD_2d)
     self.assertRaises(ValueError, funcs.contour, ax, self.ws2d_point_uneven)
Ejemplo n.º 2
0
 def test_2d_contours(self):
     fig, ax = plt.subplots()
     funcs.contour(ax, self.ws2d_histo_rag)
     funcs.contourf(ax, self.ws2d_histo, vmin=0)
     funcs.tricontour(ax, self.ws_MD_2d)
     funcs.tricontourf(ax, self.ws_MD_2d)
     self.assertRaises(ValueError, funcs.contour, ax, self.ws2d_point_uneven)
Ejemplo n.º 3
0
    def tricontourf(self, *args, **kwargs):
        """
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.tricontourf` 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.tricontourf(workspace) #for workspaces
            ax.tricontourf(x,y,z)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions.tricontourf`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions')
            workspace = args[0]
            return self.track_workspace_artist(workspace,
                                               plotfunctions.tricontourf(self, *args, **kwargs))
        else:
            return Axes.tricontourf(self, *args, **kwargs)
Ejemplo n.º 4
0
    def tricontourf(self, *args, **kwargs):
        """
        If the **mantid** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes.tricontourf` 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.tricontourf(workspace) #for workspaces
            ax.tricontourf(x,y,z)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions.tricontourf`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions')
            workspace = args[0]
            return self.track_workspace_artist(
                workspace, plotfunctions.tricontourf(self, *args, **kwargs))
        else:
            return Axes.tricontourf(self, *args, **kwargs)