예제 #1
0
 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
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
 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
 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