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

Method translate

lib/matplotlib/transforms.py:2087–2098  ·  view source on GitHub ↗

Add a translation in place. Returns *self*, so this method can easily be chained with more calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`.

(self, tx, ty)

Source from the content-addressed store, hash-verified

2085 return self.translate(-x, -y).rotate_deg(degrees).translate(x, y)
2086
2087 def translate(self, tx, ty):
2088 """
2089 Add a translation in place.
2090
2091 Returns *self*, so this method can easily be chained with more
2092 calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
2093 and :meth:`scale`.
2094 """
2095 self._mtx[0, 2] += tx
2096 self._mtx[1, 2] += ty
2097 self.invalidate()
2098 return self
2099
2100 def scale(self, sx, sy=None):
2101 """

Callers 15

_get_xy_transformMethod · 0.95
rotate_aroundMethod · 0.95
rotate_deg_aroundMethod · 0.95
test_copyMethod · 0.95
test_deepcopyMethod · 0.95
drawMethod · 0.80
get_window_extentMethod · 0.80
__call__Method · 0.80
composite_imagesFunction · 0.80
_resampleFunction · 0.80

Calls 1

invalidateMethod · 0.45

Tested by 15

test_copyMethod · 0.76
test_deepcopyMethod · 0.76
test_streamplot_limitsFunction · 0.64
test_marker_scaledFunction · 0.64
test_quiver_limitsFunction · 0.64
test_barb_limitsFunction · 0.64
test_translateMethod · 0.64