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

Method _set_axis_scale

lib/mpl_toolkits/mplot3d/axes3d.py:1132–1157  ·  view source on GitHub ↗

Set scale for an axis and constrain limits to valid range. Parameters ---------- axis : Axis The axis to set the scale on. value : str The scale name. **kwargs Forwarded to scale constructor.

(self, axis, value, **kwargs)

Source from the content-addressed store, hash-verified

1130
1131 # Custom scale setters that handle limit validation for non-linear scales
1132 def _set_axis_scale(self, axis, value, **kwargs):
1133 """
1134 Set scale for an axis and constrain limits to valid range.
1135
1136 Parameters
1137 ----------
1138 axis : Axis
1139 The axis to set the scale on.
1140 value : str
1141 The scale name.
1142 **kwargs
1143 Forwarded to scale constructor.
1144 """
1145 # For non-linear scales on the z-axis, switch from the [0, 1] +
1146 # margin=0 representation to the same xymargin + margin=0.05
1147 # representation that x/y use. Both produce identical linear limits,
1148 # but only the xymargin form has valid positive lower bounds for log
1149 # etc. This must happen before _set_axes_scale because that triggers
1150 # autoscale_view internally.
1151 if (axis is self.zaxis and value != 'linear'
1152 and np.array_equal(self.zz_dataLim.get_points(), [[0, 0], [1, 1]])):
1153 xymargin = 0.05 * 10/11
1154 self.zz_dataLim = Bbox([[xymargin, xymargin],
1155 [1 - xymargin, 1 - xymargin]])
1156 self._zmargin = self._xmargin
1157 axis._set_axes_scale(value, **kwargs)
1158
1159 def set_xscale(self, value, **kwargs):
1160 """

Callers 3

set_xscaleMethod · 0.95
set_yscaleMethod · 0.95
set_zscaleMethod · 0.95

Calls 3

BboxClass · 0.90
_set_axes_scaleMethod · 0.80
get_pointsMethod · 0.45

Tested by

no test coverage detected