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

Method _get_coord_info

lib/mpl_toolkits/mplot3d/axis3d.py:269–300  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

267 return len(text) > 4
268
269 def _get_coord_info(self):
270 # Get scaled limits directly from the axes helper
271 xmin, xmax, ymin, ymax, zmin, zmax = self.axes._get_scaled_limits()
272 mins = np.array([xmin, ymin, zmin])
273 maxs = np.array([xmax, ymax, zmax])
274
275 # Get data-space bounds for _transformed_cube
276 bounds = (*self.axes.get_xbound(),
277 *self.axes.get_ybound(),
278 *self.axes.get_zbound())
279 bounds_proj = self.axes._transformed_cube(bounds)
280
281 # Determine which one of the parallel planes are higher up:
282 means_z0 = np.zeros(3)
283 means_z1 = np.zeros(3)
284 for i in range(3):
285 means_z0[i] = np.mean(bounds_proj[self._PLANES[2 * i], 2])
286 means_z1[i] = np.mean(bounds_proj[self._PLANES[2 * i + 1], 2])
287 highs = means_z0 < means_z1
288
289 # Special handling for edge-on views
290 equals = np.abs(means_z0 - means_z1) <= np.finfo(float).eps
291 if np.sum(equals) == 2:
292 vertical = np.where(~equals)[0][0]
293 if vertical == 2: # looking at XY plane
294 highs = np.array([True, True, highs[2]])
295 elif vertical == 1: # looking at XZ plane
296 highs = np.array([True, highs[1], False])
297 elif vertical == 0: # looking at YZ plane
298 highs = np.array([highs[0], False, False])
299
300 return mins, maxs, bounds_proj, highs
301
302 def _calc_centers_deltas(self, maxs, mins):
303 centers = 0.5 * (maxs + mins)

Callers 4

active_paneMethod · 0.95
_draw_ticksMethod · 0.95
drawMethod · 0.95
draw_gridMethod · 0.95

Calls 5

_get_scaled_limitsMethod · 0.80
get_xboundMethod · 0.80
get_yboundMethod · 0.80
get_zboundMethod · 0.80
_transformed_cubeMethod · 0.80

Tested by

no test coverage detected