def test_3d_contour(self):
     fig = plt.figure()
     ax = fig.add_subplot(111, projection='mantid3d')
     funcs.contour(ax, self.ws2d_histo_rag)
     funcs.contourf(ax, self.ws2d_histo, vmin=0)
     self.assertRaises(ValueError, funcs.contour, ax,
                       self.ws2d_point_uneven)
Beispiel #2
0
    def contour(self, *args, **kwargs):
        """
        If the **mantid3d** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes3D.contour` 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':'mantid3d'})
            ax.contour(workspace) #for workspaces
            ax.contour(x,y,z)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions3D.contour`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions3D')
            return plotfunctions3D.contour(self, *args, **kwargs)
        else:
            return Axes3D.contour(self, *args, **kwargs)
Beispiel #3
0
    def contour(self, *args, **kwargs):
        """
        If the **mantid3d** projection is chosen, it can be
        used the same as :py:meth:`matplotlib.axes.Axes3D.contour` 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':'mantid3d'})
            ax.contour(workspace) #for workspaces
            ax.contour(x,y,z)     #for arrays
            fig.show()

        For keywords related to workspaces, see :func:`plotfunctions3D.contour`
        """
        if helperfunctions.validate_args(*args):
            logger.debug('using plotfunctions3D')
            return plotfunctions3D.contour(self, *args, **kwargs)
        else:
            return Axes3D.contour(self, *args, **kwargs)
 def test_3d_contour(self):
     fig = plt.figure()
     ax = fig.add_subplot(111, projection='mantid3d')
     funcs.contour(ax, self.ws2d_histo_rag)
     funcs.contourf(ax, self.ws2d_histo, vmin=0)
     self.assertRaises(ValueError, funcs.contour, ax, self.ws2d_point_uneven)