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

Function _get_data_scale

lib/mpl_toolkits/mplot3d/art3d.py:918–938  ·  view source on GitHub ↗

Estimate the scale of the 3D data for use in depth shading Parameters ---------- X, Y, Z : masked arrays The data to estimate the scale of.

(X, Y, Z)

Source from the content-addressed store, hash-verified

916
917
918def _get_data_scale(X, Y, Z):
919 """
920 Estimate the scale of the 3D data for use in depth shading
921
922 Parameters
923 ----------
924 X, Y, Z : masked arrays
925 The data to estimate the scale of.
926 """
927 # Account for empty datasets. Assume that X Y and Z have the same number
928 # of elements.
929 if not np.ma.count(X):
930 return 0
931
932 # Estimate the scale using the RSS of the ranges of the dimensions
933 # Note that we don't use np.ma.ptp() because we otherwise get a build
934 # warning about handing empty arrays.
935 ptp_x = X.max() - X.min()
936 ptp_y = Y.max() - Y.min()
937 ptp_z = Z.max() - Z.min()
938 return np.sqrt(ptp_x ** 2 + ptp_y ** 2 + ptp_z ** 2)
939
940
941class Path3DCollection(PathCollection):

Callers 1

do_3d_projectionMethod · 0.85

Calls 4

countMethod · 0.80
maxMethod · 0.80
minMethod · 0.80
sqrtMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…