|
16 | 16 | import matplotlib.collections as mcoll |
17 | 17 | import matplotlib.colors as mcolors |
18 | 18 | import matplotlib.contour as mcontour |
19 | | -import matplotlib.dates as _ # <-registers a date unit converter |
| 19 | +import matplotlib.dates as _ # <-registers a date unit converter |
20 | 20 | from matplotlib import docstring |
21 | 21 | import matplotlib.font_manager as font_manager |
22 | 22 | import matplotlib.image as mimage |
@@ -465,7 +465,7 @@ def __init__(self, fig, rect, |
465 | 465 | self._frameon = frameon |
466 | 466 | self._axisbelow = rcParams['axes.axisbelow'] |
467 | 467 |
|
468 | | - self._rasterization_zorder = -30000 |
| 468 | + self._rasterization_zorder = None |
469 | 469 |
|
470 | 470 | self._hold = rcParams['axes.hold'] |
471 | 471 | self._connected = {} # a dict from events to (id, func) |
@@ -1852,7 +1852,9 @@ def margins(self, *args, **kw): |
1852 | 1852 |
|
1853 | 1853 | def set_rasterization_zorder(self, z): |
1854 | 1854 | """ |
1855 | | - Set zorder value below which artists will be rasterized |
| 1855 | + Set zorder value below which artists will be rasterized. Set |
| 1856 | + to `None` to disable rasterizing of artists below a particular |
| 1857 | + zorder. |
1856 | 1858 | """ |
1857 | 1859 | self._rasterization_zorder = z |
1858 | 1860 |
|
@@ -2029,7 +2031,8 @@ def draw(self, renderer=None, inframe=False): |
2029 | 2031 | # rasterize artists with negative zorder |
2030 | 2032 | # if the minimum zorder is negative, start rasterization |
2031 | 2033 | rasterization_zorder = self._rasterization_zorder |
2032 | | - if len(dsu) > 0 and dsu[0][0] < rasterization_zorder: |
| 2034 | + if (rasterization_zorder is not None and |
| 2035 | + len(dsu) > 0 and dsu[0][0] < rasterization_zorder): |
2033 | 2036 | renderer.start_rasterizing() |
2034 | 2037 | dsu_rasterized = [l for l in dsu if l[0] < rasterization_zorder] |
2035 | 2038 | dsu = [l for l in dsu if l[0] >= rasterization_zorder] |
@@ -3972,7 +3975,7 @@ def plot(self, *args, **kwargs): |
3972 | 3975 |
|
3973 | 3976 | plot(x, y, color='green', linestyle='dashed', marker='o', |
3974 | 3977 | markerfacecolor='blue', markersize=12). |
3975 | | - |
| 3978 | +
|
3976 | 3979 | See :class:`~matplotlib.lines.Line2D` for details. |
3977 | 3980 |
|
3978 | 3981 | The kwargs are :class:`~matplotlib.lines.Line2D` properties: |
@@ -7073,7 +7076,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None, |
7073 | 7076 | **Example:** |
7074 | 7077 |
|
7075 | 7078 | .. plot:: mpl_examples/pylab_examples/image_demo.py |
7076 | | - |
| 7079 | +
|
7077 | 7080 | """ |
7078 | 7081 |
|
7079 | 7082 | if not self._hold: self.cla() |
@@ -7139,6 +7142,10 @@ def pcolor(self, *args, **kwargs): |
7139 | 7142 | """ |
7140 | 7143 | Create a pseudocolor plot of a 2-D array. |
7141 | 7144 |
|
| 7145 | + Note: pcolor can be very slow for large arrays; consider |
| 7146 | + using the similar but much faster |
| 7147 | + :func:`~matplotlib.pyplot.pcolormesh` instead. |
| 7148 | +
|
7142 | 7149 | Call signatures:: |
7143 | 7150 |
|
7144 | 7151 | pcolor(C, **kwargs) |
@@ -7269,6 +7276,11 @@ def pcolor(self, *args, **kwargs): |
7269 | 7276 | Stroking the edges may be preferred if *alpha* is 1, but |
7270 | 7277 | will cause artifacts otherwise. |
7271 | 7278 |
|
| 7279 | + .. seealso:: |
| 7280 | +
|
| 7281 | + :func:`~matplotlib.pyplot.pcolormesh` |
| 7282 | + For an explanation of the differences between |
| 7283 | + pcolor and pcolormesh. |
7272 | 7284 | """ |
7273 | 7285 |
|
7274 | 7286 | if not self._hold: self.cla() |
@@ -7418,7 +7430,7 @@ def pcolormesh(self, *args, **kwargs): |
7418 | 7430 |
|
7419 | 7431 | If ``'None'``, edges will not be visible. |
7420 | 7432 |
|
7421 | | - If ``'face'``, edges will have the same color as the faces. |
| 7433 | + If ``'face'``, edges will have the same color as the faces. |
7422 | 7434 |
|
7423 | 7435 | An mpl color or sequence of colors will set the edge color |
7424 | 7436 |
|
@@ -7495,23 +7507,25 @@ def pcolorfast(self, *args, **kwargs): |
7495 | 7507 | """ |
7496 | 7508 | pseudocolor plot of a 2-D array |
7497 | 7509 |
|
7498 | | - Experimental; this is a version of pcolor that |
7499 | | - does not draw lines, that provides the fastest |
7500 | | - possible rendering with the Agg backend, and that |
7501 | | - can handle any quadrilateral grid. |
| 7510 | + Experimental; this is a pcolor-type method that |
| 7511 | + provides the fastest possible rendering with the Agg |
| 7512 | + backend, and that can handle any quadrilateral grid. |
| 7513 | + It supports only flat shading (no outlines), it lacks |
| 7514 | + support for log scaling of the axes, and it does not |
| 7515 | + have a pyplot wrapper. |
7502 | 7516 |
|
7503 | 7517 | Call signatures:: |
7504 | 7518 |
|
7505 | | - pcolor(C, **kwargs) |
7506 | | - pcolor(xr, yr, C, **kwargs) |
7507 | | - pcolor(x, y, C, **kwargs) |
7508 | | - pcolor(X, Y, C, **kwargs) |
| 7519 | + ax.pcolorfast(C, **kwargs) |
| 7520 | + ax.pcolorfast(xr, yr, C, **kwargs) |
| 7521 | + ax.pcolorfast(x, y, C, **kwargs) |
| 7522 | + ax.pcolorfast(X, Y, C, **kwargs) |
7509 | 7523 |
|
7510 | 7524 | C is the 2D array of color values corresponding to quadrilateral |
7511 | 7525 | cells. Let (nr, nc) be its shape. C may be a masked array. |
7512 | 7526 |
|
7513 | | - ``pcolor(C, **kwargs)`` is equivalent to |
7514 | | - ``pcolor([0,nc], [0,nr], C, **kwargs)`` |
| 7527 | + ``ax.pcolorfast(C, **kwargs)`` is equivalent to |
| 7528 | + ``ax.pcolorfast([0,nc], [0,nr], C, **kwargs)`` |
7515 | 7529 |
|
7516 | 7530 | *xr*, *yr* specify the ranges of *x* and *y* corresponding to the |
7517 | 7531 | rectangular region bounding *C*. If:: |
|
0 commit comments