@@ -667,36 +667,3 @@ def make_axes(parent, **kw):
667667 ''' % make_axes_kw_doc
668668
669669
670- '''
671- The following does not work correctly. The problem seems to be that
672- the transforms work right only when fig.add_axes(rect) is used to
673- generate the axes, not when the axes object is generated first and
674- then fig.add_axes(ax) is called. I don't understand this. - EF
675-
676- class ColorbarAxes(axes.Axes):
677- def __init__(self, parent, **kw):
678- orientation = kw.setdefault('orientation', 'vertical')
679- fraction = kw.pop('fraction', 0.15)
680- shrink = kw.pop('shrink', 1.0)
681- aspect = kw.pop('aspect', 20)
682- self.cbkw = kw
683- pb = transforms.PBox(parent.get_position())
684- if orientation == 'vertical':
685- pb1, pbcb = pb.splitx(1.0-fraction)
686- pbcb.shrink(1.0, shrink).anchor('C')
687- anchor = (0.3, 0.5)
688- panchor = (0.8, 0.5)
689- else:
690- pbcb, pb1 = pb.splity(fraction)
691- pbcb.shrink(shrink, 1.0).anchor('C')
692- aspect = 1.0/aspect
693- anchor = (0.5, 0.2)
694- panchor = (0.5, 0.8)
695- parent.set_position(pb1)
696- parent.set_anchor(panchor)
697- fig = parent.get_figure()
698- axes.Axes.__init__(self, fig, pbcb)
699- fig.add_axes(self)
700- self.set_aspect(aspect, anchor=anchor, adjustable='box')
701-
702- '''
0 commit comments