Repository: matplotlib/matplotlib
Pull request: Document rasterized parameter in pcolormesh() explicitly
Update _axes.py to include mentions of rasterization within pcolormesh fixes #17708

PyData sprint contribution to enhance the documentation of rasterization within the pcolormesh function.

Problem statement:
Mention rasterized option in more methods
We should mention rasterized in a few places in the docstrings of relavent methods.  Ie pcolormesh, contour etc.  This option is probably the number one reason I started to use matplotlib,  but it seems a lot of people don’t realize it exists.

Hints from issue discussion:
Also, https://matplotlib.org/gallery/misc/rasterization_demo.html should get some explanatory text.
@timhoffm I'd like to take on this issue (putting explanatory text for rasterization demo)!
@jklymak How do you pass this through to contour?  @philip-sparks worked on this a bit at the pydata sprint and we could not sort out how to easily set this on contour / contourf.
Really?  I thought rasterized worked on contour, but maybe I'm incorrect.
```
In [91]: ctr = plt.contour(np.arange(42).reshape(7, 6), rasterized=True)
<ipython-input-91-3a9a3dad7a49>:1: UserWarning: The following kwargs were not used by contour: 'rasterized'
  ctr = plt.contour(np.arange(42).reshape(7, 6), rasterized=True)
```
Thats a pretty obvious wishlist item.  Particularly for `contourf` I can imagine it would be nice to rasterize sometimes

Commit message: Update _axes.py

Patch to review:
diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
index ef2e6c45f54e..32ade6a1a96b 100644
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -5834,6 +5834,12 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
            differences see :ref:`Differences between pcolor() and pcolormesh()
            <differences-pcolor-pcolormesh>`.
 
+        .. hint::
+            `In order to speed up image processing of a plot with a large
+            amount of points, pcolormesh allows the use of the `rasterized`
+            keyword. As an example, see
+            :ref https://matplotlib.org/gallery/misc/rasterization_demo.html`.
+
         Parameters
         ----------
         C : array-like
@@ -5925,6 +5931,9 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
         snap : bool, default: False
             Whether to snap the mesh to pixel boundaries.
 
+        rasterized: bool, optional
+            Force rasterized (bitmap) drawing in vector backend output.
+
         Returns
         -------
         `matplotlib.collections.QuadMesh`


Code review comments:
diff_hunk: @@ -5925,6 +5931,9 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
         snap : bool, default: False
             Whether to snap the mesh to pixel boundaries.
 
+        rasterized: bool, optional
+            Force rasterized (bitmap) drawing in vector backend output.
path: lib/matplotlib/axes/_axes.py
text: @user1:
```suggestion
            Rasterize the pcolormesh before drawing.  Can be faster and make smaller files for large data sets.
```