MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _draw_disabled

Method _draw_disabled

lib/matplotlib/backend_bases.py:682–698  ·  view source on GitHub ↗

Context manager to temporary disable drawing. This is used for getting the drawn size of Artists. This lets us run the draw process to update any Python state but does not pay the cost of the draw_XYZ calls on the canvas.

(self)

Source from the content-addressed store, hash-verified

680 """
681
682 def _draw_disabled(self):
683 """
684 Context manager to temporary disable drawing.
685
686 This is used for getting the drawn size of Artists. This lets us
687 run the draw process to update any Python state but does not pay the
688 cost of the draw_XYZ calls on the canvas.
689 """
690 no_ops = {
691 meth_name: functools.update_wrapper(lambda *args, **kwargs: None,
692 getattr(RendererBase, meth_name))
693 for meth_name in dir(RendererBase)
694 if (meth_name.startswith("draw_")
695 or meth_name in ["open_group", "close_group"])
696 }
697
698 return _setattr_cm(self, **no_ops)
699
700
701class GraphicsContextBase:

Callers 1

Calls 1

_setattr_cmFunction · 0.90

Tested by

no test coverage detected