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

Method _get_clip_cmd

lib/matplotlib/backends/backend_ps.py:557–577  ·  view source on GitHub ↗
(self, gc)

Source from the content-addressed store, hash-verified

555 6, [b"m", b"l", b"", b"c", b"cl"], True).decode("ascii")
556
557 def _get_clip_cmd(self, gc):
558 clip = []
559 rect = gc.get_clip_rectangle()
560 if rect is not None:
561 clip.append(f"{_nums_to_str(*rect.p0, *rect.size)} rectclip\n")
562 path, trf = gc.get_clip_path()
563 if path is not None:
564 key = (path, id(trf))
565 custom_clip_cmd = self._clip_paths.get(key)
566 if custom_clip_cmd is None:
567 custom_clip_cmd = "c%d" % len(self._clip_paths)
568 self._pswriter.write(f"""\
569/{custom_clip_cmd} {{
570{self._convert_path(path, trf, simplify=False)}
571clip
572newpath
573}} bind def
574""")
575 self._clip_paths[key] = custom_clip_cmd
576 clip.append(f"{custom_clip_cmd}\n")
577 return "".join(clip)
578
579 @_log_if_debug_on
580 def draw_image(self, gc, x, y, im, transform=None):

Callers 3

draw_imageMethod · 0.95
draw_textMethod · 0.95
_draw_psMethod · 0.95

Calls 7

_convert_pathMethod · 0.95
_nums_to_strFunction · 0.85
get_clip_rectangleMethod · 0.80
joinMethod · 0.80
get_clip_pathMethod · 0.45
getMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected