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

Method draw

lib/matplotlib/projections/polar.py:963–1009  ·  view source on GitHub ↗
(self, renderer)

Source from the content-addressed store, hash-verified

961 return self._yaxis_text_transform + pad_shift, 'center', halign
962
963 def draw(self, renderer):
964 self._unstale_viewLim()
965 thetamin, thetamax = np.rad2deg(self._realViewLim.intervalx)
966 if thetamin > thetamax:
967 thetamin, thetamax = thetamax, thetamin
968 rscale_tr = self.yaxis.get_transform()
969 rmin, rmax = ((rscale_tr.transform(self._realViewLim.intervaly) -
970 rscale_tr.transform(self.get_rorigin())) *
971 self.get_rsign())
972 if isinstance(self.patch, mpatches.Wedge):
973 # Backwards-compatibility: Any subclassed Axes might override the
974 # patch to not be the Wedge that PolarAxes uses.
975 center = self.transWedge.transform((0.5, 0.5))
976 self.patch.set_center(center)
977 self.patch.set_theta1(thetamin)
978 self.patch.set_theta2(thetamax)
979
980 edge, _ = self.transWedge.transform((1, 0))
981 radius = edge - center[0]
982 width = min(radius * (rmax - rmin) / rmax, radius)
983 self.patch.set_radius(radius)
984 self.patch.set_width(width)
985
986 inner_width = radius - width
987 inner = self.spines.get('inner', None)
988 if inner:
989 inner.set_visible(inner_width != 0.0)
990
991 visible = not _is_full_circle_deg(thetamin, thetamax)
992 # For backwards compatibility, any subclassed Axes might override the
993 # spines to not include start/end that PolarAxes uses.
994 start = self.spines.get('start', None)
995 end = self.spines.get('end', None)
996 if start:
997 start.set_visible(visible)
998 if end:
999 end.set_visible(visible)
1000 if visible:
1001 yaxis_text_transform = self._yaxis_transform
1002 else:
1003 yaxis_text_transform = self._r_label_position + self.transData
1004 if self._yaxis_text_transform != yaxis_text_transform:
1005 self._yaxis_text_transform.set(yaxis_text_transform)
1006 self.yaxis.reset_ticks()
1007 self.yaxis.set_clip_path(self.patch)
1008
1009 super().draw(renderer)
1010
1011 def _gen_axes_patch(self):
1012 return mpatches.Wedge((0.5, 0.5), 0.5, 0.0, 360.0)

Callers

nothing calls this directly

Calls 15

get_roriginMethod · 0.95
get_rsignMethod · 0.95
_is_full_circle_degFunction · 0.85
_unstale_viewLimMethod · 0.80
set_theta1Method · 0.80
set_theta2Method · 0.80
reset_ticksMethod · 0.80
get_transformMethod · 0.45
transformMethod · 0.45
set_centerMethod · 0.45
set_radiusMethod · 0.45
set_widthMethod · 0.45

Tested by

no test coverage detected