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

Method set_snap

lib/matplotlib/artist.py:662–688  ·  view source on GitHub ↗

Set the snapping behavior. Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of

(self, snap)

Source from the content-addressed store, hash-verified

660 return False
661
662 def set_snap(self, snap):
663 """
664 Set the snapping behavior.
665
666 Snapping aligns positions with the pixel grid, which results in
667 clearer images. For example, if a black line of 1px width was
668 defined at a position in between two pixels, the resulting image
669 would contain the interpolated value of that line in the pixel grid,
670 which would be a grey value on both adjacent pixel positions. In
671 contrast, snapping will move the line to the nearest integer pixel
672 value, so that the resulting image will really contain a 1px wide
673 black line.
674
675 Snapping is currently only supported by the Agg and MacOSX backends.
676
677 Parameters
678 ----------
679 snap : bool or None
680 Possible values:
681
682 - *True*: Snap vertices to the nearest pixel center.
683 - *False*: Do not modify vertex positions.
684 - *None*: (auto) If the path contains only rectilinear line
685 segments, round to the nearest pixel center.
686 """
687 self._snap = snap
688 self.stale = True
689
690 def get_sketch_params(self):
691 """

Callers 7

__init__Method · 0.45
drawMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected