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

Function _apply_scale_transforms

lib/mpl_toolkits/mplot3d/proj3d.py:134–158  ·  view source on GitHub ↗

Apply axis scale transforms to 3D coordinates. Transforms data coordinates to transformed coordinates (applying log, symlog, etc.) for 3D projection. Preserves masked arrays.

(xs, ys, zs, axes)

Source from the content-addressed store, hash-verified

132
133
134def _apply_scale_transforms(xs, ys, zs, axes):
135 """
136 Apply axis scale transforms to 3D coordinates.
137
138 Transforms data coordinates to transformed coordinates (applying log,
139 symlog, etc.) for 3D projection. Preserves masked arrays.
140 """
141 def transform_coord(coord, axis):
142 coord = np.asanyarray(coord)
143 data = np.ma.getdata(coord).ravel()
144 return axis.get_transform().transform(data).reshape(coord.shape)
145
146 xs_scaled = transform_coord(xs, axes.xaxis)
147 ys_scaled = transform_coord(ys, axes.yaxis)
148 zs_scaled = transform_coord(zs, axes.zaxis)
149
150 # Preserve combined mask from any masked input
151 masks = [np.ma.getmask(a) for a in [xs, ys, zs]]
152 if any(m is not np.ma.nomask for m in masks):
153 combined = np.ma.mask_or(np.ma.mask_or(masks[0], masks[1]), masks[2])
154 xs_scaled = np.ma.array(xs_scaled, mask=combined)
155 ys_scaled = np.ma.array(ys_scaled, mask=combined)
156 zs_scaled = np.ma.array(zs_scaled, mask=combined)
157
158 return xs_scaled, ys_scaled, zs_scaled
159
160
161def _proj_transform_vec(vec, M):

Callers 3

_scale_proj_transformFunction · 0.85

Calls 1

transform_coordFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…