8000 DOC: add docstring to too-clever helper function · matplotlib/matplotlib@eb52a34 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb52a34

Browse files
committed
DOC: add docstring to too-clever helper function
1 parent 5ece54c commit eb52a34

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4639,6 +4639,43 @@ def _label_outer_yaxis(self, *, check_patch):
46394639

46404640

46414641
def _draw_rasterized(figure, artists, renderer):
4642+
"""
4643+
A helper function for rasterizing the list of artists.
4644+
4645+
The bookkeeping to track if we are or are not in rasterizing mode
4646+
with the mixed-mode backends is relatively complicated and is now
4647+
handled in the matplotlib.artist.allow_rasterization decorator.
4648+
4649+
This helper defines the absolute minimum methods and attributes on
4650+
shim class to be compatible with that decorator and the uses it to
4651+
rasterize the list of artists.
4652+
4653+
This is maybe too-clever, but allows us to re-use the same code that is
4654+
used on normal artists to participate in the "are we rasterizing"
4655+
accounting.
4656+
4657+
Please do not use this outside of the "rasterize below a given zorder"
4658+
functionality of Axes.
4659+
4660+
Parameters
4661+
----------
4662+
figure : matplotlib.figure.Figure
4663+
The figure all of the artists belong to (not checked). We need this
4664+
because we can at the figure level suppress composition and insert each
4665+
rasterized artist as it's own image.
4666+
4667+
artists : List[matplotlib.artist.Artist]
4668+
The list of Artists to be rasterized. These are assumed to all
4669+
be in the same Figure.
4670+
4671+
renderer : matplotlib.backendbases.RendererBase
4672+
The currently active renderer
4673+
4674+
Returns
4675+
-------
4676+
None
4677+
4678+
"""
46424679
class _MinimalArtist:
46434680
def get_rasterized(self):
46444681
return True

0 commit comments

Comments
 (0)
0