Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 174d8c9

Browse files
committed
support for shared axes
svn path=/trunk/matplotlib/; revision=893
1 parent 102cc69 commit 174d8c9

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,9 @@ def __init__(self, fig, rect,
323323
self._sharey = sharey
324324

325325
self.set_figure(fig)
326-
327-
self.xaxis = XAxis(self)
328-
self.yaxis = YAxis(self)
329-
326+
327+
# this call may differ for non-sep axes, eg polar
328+
self._init_axis()
330329

331330

332331
if axisbg is None: axisbg = rcParams['axes.facecolor']
@@ -341,6 +340,11 @@ def __init__(self, fig, rect,
341340
# funcs used to format x and y - fall back on major formatters
342341
self.fmt_xdata = None
343342
self.fmt_ydata = None
343+
344+
def _init_axis(self):
345+
"move this out of __init__ because non-separable axes don't use it"
346+
self.xaxis = XAxis(self)
347+
self.yaxis = YAxis(self)
344348

345349
def set_figure(self, fig):
346350
"""
@@ -3393,6 +3397,9 @@ def __init__(self, *args, **kwarg):
33933397
self.rgridlines = []
33943398
Axes.__init__(self, *args, **kwarg)
33953399

3400+
def _init_axis(self):
3401+
"nuthin to do"
3402+
pass
33963403
def _set_lim_and_transforms(self):
33973404
"""
33983405
set the dataLim and viewLim BBox attributes and the

0 commit comments

Comments
 (0)