Example #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)
Example #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
Example #3
0
    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()
Example #4
0
 def test_outline(self):
     iplt.outline(self.cube)
     self.check_graphic()
Example #5
0
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
Example #6
0
 def test_xaxis_labels(self):
     iplt.outline(self.cube, coords=('str_coord', 'bar'))
     self.assertBoundsTickLabels('xaxis')
Example #7
0
 def test_grid(self):
     iplt.outline(self.cube)
     self.check_graphic()
Example #8
0
 def test_xaxis_labels(self):
     iplt.outline(self.cube, coords=('str_coord', 'bar'))
     self.assertBoundsTickLabels('xaxis')
Example #9
0
 def test_xaxis_labels(self):
     iplt.outline(self.cube, coords=("str_coord", "bar"))
     self.assertBoundsTickLabels("xaxis")
Example #10
0
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