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

Method autoscale_view

lib/mpl_toolkits/mplot3d/axes3d.py:693–732  ·  view source on GitHub ↗

Autoscale the view limits using the data limits. See `.Axes.autoscale_view` for full documentation. Because this function applies to 3D Axes, it also takes a *scalez* argument.

(self, tight=None,
                       scalex=True, scaley=True, scalez=True)

Source from the content-addressed store, hash-verified

691 set_bound(v0, v1, self._view_margin)
692
693 def autoscale_view(self, tight=None,
694 scalex=True, scaley=True, scalez=True):
695 """
696 Autoscale the view limits using the data limits.
697
698 See `.Axes.autoscale_view` for full documentation. Because this
699 function applies to 3D Axes, it also takes a *scalez* argument.
700 """
701 # This method looks at the rectangular volume (see above)
702 # of data and decides how to scale the view portal to fit it.
703 if tight is None:
704 _tight = self._tight
705 if not _tight:
706 # if image data only just use the datalim
707 for artist in self._children:
708 if isinstance(artist, mimage.AxesImage):
709 _tight = True
710 elif isinstance(artist, (mlines.Line2D, mpatches.Patch)):
711 _tight = False
712 break
713 else:
714 _tight = self._tight = bool(tight)
715
716 if scalex and self.get_autoscalex_on():
717 self._autoscale_axis(
718 self.xaxis, *self.xy_dataLim.intervalx,
719 self.xy_dataLim.minposx, self._xmargin,
720 self.set_xbound, _tight)
721
722 if scaley and self.get_autoscaley_on():
723 self._autoscale_axis(
724 self.yaxis, *self.xy_dataLim.intervaly,
725 self.xy_dataLim.minposy, self._ymargin,
726 self.set_ybound, _tight)
727
728 if scalez and self.get_autoscalez_on():
729 self._autoscale_axis(
730 self.zaxis, *self.zz_dataLim.intervalx,
731 self.zz_dataLim.minposx, self._zmargin,
732 self.set_zbound, _tight)
733
734 def get_w_lims(self):
735 """Get 3D world limits."""

Callers 4

__init__Method · 0.95
marginsMethod · 0.95
auto_scale_xyzMethod · 0.95
clearMethod · 0.95

Calls 1

_autoscale_axisMethod · 0.95

Tested by

no test coverage detected