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

Method _print_pgf_clip

lib/matplotlib/backends/backend_pgf.py:488–506  ·  view source on GitHub ↗
(self, gc)

Source from the content-addressed store, hash-verified

486 _writeln(self.fh, r"\end{pgfscope}")
487
488 def _print_pgf_clip(self, gc):
489 f = 1. / self.dpi
490 # check for clip box
491 bbox = gc.get_clip_rectangle()
492 if bbox:
493 p1, p2 = bbox.get_points()
494 w, h = p2 - p1
495 coords = p1[0] * f, p1[1] * f, w * f, h * f
496 _writeln(self.fh,
497 r"\pgfpathrectangle"
498 r"{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}"
499 % coords)
500 _writeln(self.fh, r"\pgfusepath{clip}")
501
502 # check for clip path
503 clippath, clippath_trans = gc.get_clip_path()
504 if clippath is not None:
505 self._print_pgf_path(gc, clippath, clippath_trans)
506 _writeln(self.fh, r"\pgfusepath{clip}")
507
508 def _print_pgf_path_styles(self, gc, rgbFace):
509 # cap style

Callers 4

draw_markersMethod · 0.95
draw_pathMethod · 0.95
draw_imageMethod · 0.95
draw_textMethod · 0.95

Calls 5

_print_pgf_pathMethod · 0.95
_writelnFunction · 0.85
get_clip_rectangleMethod · 0.80
get_pointsMethod · 0.45
get_clip_pathMethod · 0.45

Tested by

no test coverage detected