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

Class _User2DTransform

lib/mpl_toolkits/axisartist/grid_finder.py:101–126  ·  view source on GitHub ↗

A transform defined by two user-set functions.

Source from the content-addressed store, hash-verified

99
100
101class _User2DTransform(Transform):
102 """A transform defined by two user-set functions."""
103
104 input_dims = output_dims = 2
105
106 def __init__(self, forward, backward):
107 """
108 Parameters
109 ----------
110 forward, backward : callable
111 The forward and backward transforms, taking ``x`` and ``y`` as
112 separate arguments and returning ``(tr_x, tr_y)``.
113 """
114 # The normal Matplotlib convention would be to take and return an
115 # (N, 2) array but axisartist uses the transposed version.
116 super().__init__()
117 self._forward = forward
118 self._backward = backward
119
120 def transform_non_affine(self, values):
121 # docstring inherited
122 return np.transpose(self._forward(*np.transpose(values)))
123
124 def inverted(self):
125 # docstring inherited
126 return type(self)(self._backward, self._forward)
127
128
129class GridFinder:

Callers 2

__call__Method · 0.85
set_transformMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…