コード例 #1
0
ファイル: test_outline.py プロジェクト: MahatmaCane/iris
 def test_yaxis_labels_with_axes(self):
     import matplotlib.pyplot as plt
     fig = plt.figure()
     ax = fig.add_subplot(111)
     ax.set_ylim(0, 3)
     iplt.outline(self.cube, axes=ax, coords=('bar', 'str_coord'))
     plt.close(fig)
     self.assertPointsTickLabels('yaxis', ax)
コード例 #2
0
ファイル: quickplot.py プロジェクト: AntoinedDMO/iris
def outline(cube, coords=None, color='k', linewidth=None):
    """
    Draws cell outlines on a labelled plot based on the given Cube.

    Kwargs:

    * coords: list of :class:`~iris.coords.Coord` objects or coordinate names
        Use the given coordinates as the axes for the plot. The order of the
        given coordinates indicates which axis to use for each, where the first
        element is the horizontal axis of the plot and the second element is
        the vertical axis of the plot.

    * color: None or mpl color
        The color of the cell outlines. If None, the matplotlibrc setting
        patch.edgecolor is used by default.

    * linewidth: None or number
        The width of the lines showing the cell outlines. If None, the default
        width in patch.linewidth in matplotlibrc is used.

    """
    result = iplt.outline(cube, color=color, linewidth=linewidth,
                          coords=coords)

    _label_with_bounds(cube, coords=coords)
    return result
コード例 #3
0
ファイル: test_plot.py プロジェクト: QuLogic/iris
    def test_orography(self):
        qplt.contourf(self.cube)
        iplt.orography_at_points(self.cube)
        iplt.points(self.cube)
        self.check_graphic()

        coords = ['altitude', 'grid_longitude']
        qplt.contourf(self.cube, coords=coords)
        iplt.orography_at_points(self.cube, coords=coords)
        iplt.points(self.cube, coords=coords)
        self.check_graphic()

        # TODO: Test bounds once they are supported.
        with self.assertRaises(NotImplementedError):
            qplt.pcolor(self.cube)
            iplt.orography_at_bounds(self.cube)
            iplt.outline(self.cube)
            self.check_graphic()
コード例 #4
0
ファイル: test_mapping.py プロジェクト: bamundi/iris
 def test_outline(self):
     iplt.outline(self.cube)
     self.check_graphic()
コード例 #5
0
ファイル: quickplot.py プロジェクト: Jozhogg/iris
def outline(cube, coords=None):
    """Draws cell outlines on a labelled plot based on the given Cube."""
    result = iplt.outline(cube, coords=coords)
    _label_with_bounds(cube, coords=coords)
    return result
コード例 #6
0
ファイル: test_outline.py プロジェクト: fionaRust/iris
 def test_xaxis_labels(self):
     iplt.outline(self.cube, coords=('str_coord', 'bar'))
     self.assertBoundsTickLabels('xaxis')
コード例 #7
0
 def test_grid(self):
     iplt.outline(self.cube)
     self.check_graphic()
コード例 #8
0
 def test_xaxis_labels(self):
     iplt.outline(self.cube, coords=('str_coord', 'bar'))
     self.assertBoundsTickLabels('xaxis')
コード例 #9
0
 def test_xaxis_labels(self):
     iplt.outline(self.cube, coords=("str_coord", "bar"))
     self.assertBoundsTickLabels("xaxis")
コード例 #10
0
ファイル: quickplot.py プロジェクト: nleush/iris
def outline(cube, coords=None):
    """Draws cell outlines on a labelled plot based on the given Cube."""
    result = iplt.outline(cube, coords=coords)
    _label_with_bounds(cube, coords=coords)
    return result