From efb3f5ad446c3172eaf0af3343d3cc74e37c2c79 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Tue, 4 Aug 2015 23:16:46 -0400 Subject: [PATCH 1/9] Cleanup axes_grid1.anchored_artists Remove non-library (and unusable) code Remove unused imports Fixed pylint issues with indentation --- .../axes_grid1/anchored_artists.py | 94 ++----------------- 1 file changed, 7 insertions(+), 87 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 5cc7c07a2e3c..733f08c4d77f 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -1,15 +1,10 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) -from matplotlib.externals import six - +from matplotlib.offsetbox import (AnchoredOffsetbox, AuxTransformBox, + DrawingArea, TextArea, VPacker) from matplotlib.patches import Rectangle, Ellipse -import numpy as np - -from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, VPacker,\ - TextArea, AnchoredText, DrawingArea, AnnotationBbox - class AnchoredDrawingArea(AnchoredOffsetbox): """ @@ -23,21 +18,18 @@ def __init__(self, width, height, xdescent, ydescent, *width*, *height*, *xdescent*, *ydescent* : the dimensions of the DrawingArea. *prop* : font property. This is only used for scaling the paddings. """ - self.da = DrawingArea(width, height, xdescent, ydescent) self.drawing_area = self.da - super(AnchoredDrawingArea, self).__init__(loc, pad=pad, borderpad=borderpad, - child=self.da, - prop=None, - frameon=frameon, - **kwargs) + super(AnchoredDrawingArea, self).__init__( + loc, pad=pad, borderpad=borderpad, child=self.da, prop=None, + frameon=frameon, **kwargs + ) class AnchoredAuxTransformBox(AnchoredOffsetbox): def __init__(self, transform, loc, pad=0.4, borderpad=0.5, prop=None, frameon=True, **kwargs): - self.drawing_area = AuxTransformBox(transform) AnchoredOffsetbox.__init__(self, loc, pad=pad, borderpad=borderpad, @@ -47,7 +39,6 @@ def __init__(self, transform, loc, **kwargs) - class AnchoredEllipse(AnchoredOffsetbox): def __init__(self, transform, width, height, angle, loc, pad=0.1, borderpad=0.1, prop=None, frameon=True, **kwargs): @@ -57,7 +48,7 @@ def __init__(self, transform, width, height, angle, loc, pad, borderpad in fraction of the legend font size (or prop) """ self._box = AuxTransformBox(transform) - self.ellipse = Ellipse((0,0), width, height, angle) + self.ellipse = Ellipse((0, 0), width, height, angle) self._box.add_artist(self.ellipse) AnchoredOffsetbox.__init__(self, loc, pad=pad, borderpad=borderpad, @@ -122,7 +113,6 @@ def __init__(self, transform, size, label, loc, >>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.5, color='white', fontproperties=fontprops) """ - self.size_bar = AuxTransformBox(transform) self.size_bar.add_artist(Rectangle((0, 0), size, size_vertical, fill=True, facecolor=color, @@ -157,73 +147,3 @@ def __init__(self, transform, size, label, loc, child=self._box, prop=fontproperties, frameon=frameon, **kwargs) - - -if __name__ == "__main__": - - import matplotlib.pyplot as plt - - fig = plt.gcf() - fig.clf() - ax = plt.subplot(111) - - offsetbox = AnchoredText("Test", loc=6, pad=0.3, - borderpad=0.3, prop=None) - xy = (0.5, 0.5) - ax.plot([0.5], [0.5], "xk") - ab = AnnotationBbox(offsetbox, xy, - xybox=(1., .5), - xycoords='data', - boxcoords=("axes fraction", "data"), - arrowprops=dict(arrowstyle="->")) - #arrowprops=None) - - ax.add_artist(ab) - - - from matplotlib.patches import Circle - ada = AnchoredDrawingArea(20, 20, 0, 0, - loc=6, pad=0.1, borderpad=0.3, frameon=True) - p = Circle((10, 10), 10) - ada.da.add_artist(p) - - ab = AnnotationBbox(ada, (0.3, 0.4), - xybox=(1., 0.4), - xycoords='data', - boxcoords=("axes fraction", "data"), - arrowprops=dict(arrowstyle="->")) - #arrowprops=None) - - ax.add_artist(ab) - - - arr = np.arange(100).reshape((10,10)) - im = AnchoredImage(arr, - loc=4, - pad=0.5, borderpad=0.2, prop=None, frameon=True, - zoom=1, - cmap = None, - norm = None, - interpolation=None, - origin=None, - extent=None, - filternorm=1, - filterrad=4.0, - resample = False, - ) - - ab = AnnotationBbox(im, (0.5, 0.5), - xybox=(-10., 10.), - xycoords='data', - boxcoords="offset points", - arrowprops=dict(arrowstyle="->")) - #arrowprops=None) - - ax.add_artist(ab) - - ax.set_xlim(0, 1) - ax.set_ylim(0, 1) - - - plt.draw() - plt.show() From c27633ca4074b85acec6dc48333557dbab8e9899 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Wed, 5 Aug 2015 23:27:48 -0400 Subject: [PATCH 2/9] Add documentation to axes_grid1.anchored_artists.AnchoredSizeBar --- .../axes_grid1/anchored_artists.py | 93 +++++++++++++------ 1 file changed, 67 insertions(+), 26 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 733f08c4d77f..ca1591bafed2 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -1,6 +1,7 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) +from matplotlib import docstring from matplotlib.offsetbox import (AnchoredOffsetbox, AuxTransformBox, DrawingArea, TextArea, VPacker) from matplotlib.patches import Rectangle, Ellipse @@ -58,51 +59,92 @@ def __init__(self, transform, width, height, angle, loc, class AnchoredSizeBar(AnchoredOffsetbox): + @docstring.dedent def __init__(self, transform, size, label, loc, pad=0.1, borderpad=0.1, sep=2, frameon=True, size_vertical=0, color='black', label_top=False, fontproperties=None, **kwargs): """ - Draw a horizontal bar with the size in data coordinate of the given axes. - A label will be drawn underneath (center-aligned). + Draw a horizontal scale bar with a center-aligned label underneath. + + Parameters + ---------- + transform : `matplotlib.transforms.Transform` + The transformation object for the coordinate system in use, i.e., + :attr:`matplotlib.axes.Axes.transData`. - Parameters: - ----------- - transform : matplotlib transformation object size : int or float - horizontal length of the size bar, given in data coordinates + Horizontal length of the size bar, given in coordinates of + *transform*. + label : str + Label to display. + loc : int + Location of this size bar. Valid location codes are:: + + 'upper right' : 1, + 'upper left' : 2, + 'lower left' : 3, + 'lower right' : 4, + 'right' : 5, + 'center left' : 6, + 'center right' : 7, + 'lower center' : 8, + 'upper center' : 9, + 'center' : 10 + pad : int or float, optional - in fraction of the legend font size (or prop) + Padding around the label and size bar, in fraction of the font + size. Defaults to 0.1. + borderpad : int or float, optional - in fraction of the legend font size (or prop) + Border padding, in fraction of the font size. + Defaults to 0.1. + sep : int or float, optional - in points + Seperation between the label and the size bar, in points. + Defaults to 2. + frameon : bool, optional - if True, will draw a box around the horizontal bar and label + If True, draw a box around the horizontal bar and label. + Defaults to True. + size_vertical : int or float, optional - vertical length of the size bar, given in data coordinates + Vertical length of the size bar, given in coordinates of + *transform*. Defaults to 0. + color : str, optional - color for the size bar and label + Color for the size bar and label. + Defaults to black. + label_top : bool, optional - if True, the label will be over the rectangle - fontproperties: a matplotlib.font_manager.FontProperties instance, optional - sets the font properties for the label text + If True, the label will be over the size bar. + Defaults to False. - Returns: - -------- - AnchoredSizeBar object + fontproperties : `matplotlib.font_manager.FontProperties`, optional + Font properties for the label text. - Example: + **kwargs : + Keyworded arguments to pass to + :class:`matplotlib.offsetbox.AnchoredOffsetbox`. + + Notes + ----- + If *prop* is passed as a keyworded argument, but *fontproperties* is + not, then *prop* is be assumed to be the intended *fontproperties*. + Using both *prop* and *fontproperties* is not supported. + + Examples -------- >>> import matplotlib.pyplot as plt >>> import numpy as np - >>> from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar + >>> from mpl_toolkits.axes_grid1.anchored_artists import \ +AnchoredSizeBar >>> fig, ax = plt.subplots() >>> ax.imshow(np.random.random((10,10))) - >>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4) + >>> bar = AnchoredSizeBar(ax.transData, 3, '3 data units', 4) >>> ax.add_artist(bar) >>> fig.show() @@ -110,17 +152,16 @@ def __init__(self, transform, size, label, loc, >>> import matplotlib.font_manager as fm >>> fontprops = fm.FontProperties(size=14, family='monospace') - >>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5, sep=5, borderpad=0.5, frameon=False, size_vertical=0.5, color='white', fontproperties=fontprops) - + >>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5, \ +sep=5, borderpad=0.5, frameon=False, \ +size_vertical=0.5, color='white', \ +fontproperties=fontprops) """ self.size_bar = AuxTransformBox(transform) self.size_bar.add_artist(Rectangle((0, 0), size, size_vertical, fill=True, facecolor=color, edgecolor=color)) - # if fontproperties is None, but `prop` is not, assume that - # prop should be used to set the font properties. This is - # questionable behavior if fontproperties is None and 'prop' in kwargs: fontproperties = kwargs.pop('prop') From e8579ded506d95f09bba2c760e4f4c80725aa42a Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Thu, 6 Aug 2015 07:22:41 -0400 Subject: [PATCH 3/9] Add documentation to axes_grid1.anchored_artists.AnchoredEllipse --- .../axes_grid1/anchored_artists.py | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index ca1591bafed2..7390541d5dcf 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -41,12 +41,55 @@ def __init__(self, transform, loc, class AnchoredEllipse(AnchoredOffsetbox): + @docstring.dedent def __init__(self, transform, width, height, angle, loc, pad=0.1, borderpad=0.1, prop=None, frameon=True, **kwargs): """ - Draw an ellipse the size in data coordinate of the give axes. + Draw an anchored ellipse of a given size. + + Parameters + ---------- + transform : `matplotlib.transforms.Transform` + The transformation object for the coordinate system in use, i.e., + :attr:`matplotlib.axes.Axes.transData`. + + width, height : int or float + Width and height of the ellipse, given in coordinates of + *transform*. + + angle : int or float + Rotation of the ellipse, in degrees, anti-clockwise. + + loc : int + Location of this size bar. Valid location codes are:: + + 'upper right' : 1, + 'upper left' : 2, + 'lower left' : 3, + 'lower right' : 4, + 'right' : 5, + 'center left' : 6, + 'center right' : 7, + 'lower center' : 8, + 'upper center' : 9, + 'center' : 10 + + pad : int or float, optional + Padding around the ellipse, in fraction of the font size. Defaults + to 0.1. - pad, borderpad in fraction of the legend font size (or prop) + borderpad : int or float, optional + Border padding, in fraction of the font size. Defaults to 0.1. + + frameon : bool, optional + If True, draw a box around the ellipse. Defaults to True. + + prop : `matplotlib.font_manager.FontProperties`, optional + Font property used as a reference for paddings. + + **kwargs : + Keyworded arguments to pass to + :class:`matplotlib.offsetbox.AnchoredOffsetbox`. """ self._box = AuxTransformBox(transform) self.ellipse = Ellipse((0, 0), width, height, angle) From 8ee87079c4cb7f68aedc135cf7e49e00bf2db413 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Thu, 6 Aug 2015 07:43:36 -0400 Subject: [PATCH 4/9] Add attributes doc for AnchoredSizeBar and AnchoredEllipse in axes_grid1 --- lib/mpl_toolkits/axes_grid1/anchored_artists.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 7390541d5dcf..0bf311937220 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -90,6 +90,11 @@ def __init__(self, transform, width, height, angle, loc, **kwargs : Keyworded arguments to pass to :class:`matplotlib.offsetbox.AnchoredOffsetbox`. + + Attributes + ---------- + ellipse : `matplotlib.patches.Ellipse` + Ellipse patch drawn. """ self._box = AuxTransformBox(transform) self.ellipse = Ellipse((0, 0), width, height, angle) @@ -173,6 +178,14 @@ def __init__(self, transform, size, label, loc, Keyworded arguments to pass to :class:`matplotlib.offsetbox.AnchoredOffsetbox`. + Attributes + ---------- + size_bar : `matplotlib.offsetbox.AuxTransformBox` + Container for the size bar. + + txt_label : `matplotlib.offsetbox.TextArea` + Container for the label of the size bar. + Notes ----- If *prop* is passed as a keyworded argument, but *fontproperties* is From c574197b64fb4d8a50fe90aaccafede493d83f36 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Thu, 6 Aug 2015 12:13:24 -0400 Subject: [PATCH 5/9] Add documentation for axes_grid1's AnchoredAuxTransformBox --- .../axes_grid1/anchored_artists.py | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 0bf311937220..4821994fb3bc 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -29,8 +29,68 @@ def __init__(self, width, height, xdescent, ydescent, class AnchoredAuxTransformBox(AnchoredOffsetbox): + @docstring.dedent def __init__(self, transform, loc, pad=0.4, borderpad=0.5, prop=None, frameon=True, **kwargs): + """ + An anchored container with transformed coordinates. + + Artists added to the *drawing_area* are scaled according to the + coordinates of the transformation used. The dimensions of this artist + will scale to contain the artists added. + + Parameters + ---------- + transform : `matplotlib.transforms.Transform` + The transformation object for the coordinate system in use, i.e., + :attr:`matplotlib.axes.Axes.transData`. + + loc : int + Location of this artist. Valid location codes are:: + + 'upper right' : 1, + 'upper left' : 2, + 'lower left' : 3, + 'lower right' : 4, + 'right' : 5, + 'center left' : 6, + 'center right' : 7, + 'lower center' : 8, + 'upper center' : 9, + 'center' : 10 + + pad : int or float, optional + Padding around the child objects, in fraction of the font + size. Defaults to 0.4. + + borderpad : int or float, optional + Border padding, in fraction of the font size. + Defaults to 0.5. + + prop : `matplotlib.font_manager.FontProperties`, optional + Font property used as a reference for paddings. + + frameon : bool, optional + If True, draw a box around this artists. Defaults to True. + + **kwargs : + Keyworded arguments to pass to + :class:`matplotlib.offsetbox.AnchoredOffsetbox`. + + Attributes + ---------- + drawing_area : `matplotlib.offsetbox.AuxTransformBox` + + Examples + -------- + To display an ellipse in the upper left, with a width of 0.1 and + height of 0.4 in data coordinates: + + >>> box = AnchoredAuxTransformBox(ax.transData, loc=2) + >>> el = Ellipse((0,0), width=0.1, height=0.4, angle=30) + >>> box.drawing_area.add_artist(el) + >>> ax.add_artist(box) + """ self.drawing_area = AuxTransformBox(transform) AnchoredOffsetbox.__init__(self, loc, pad=pad, borderpad=borderpad, From ba12801803677b25baf0332d77132f56aa272fdd Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Thu, 6 Aug 2015 15:01:00 -0400 Subject: [PATCH 6/9] Add documentation for axes_grid1's AnchoredDrawingArea --- .../axes_grid1/anchored_artists.py | 68 +++++++++++++++++-- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 4821994fb3bc..7c06042119aa 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -8,16 +8,71 @@ class AnchoredDrawingArea(AnchoredOffsetbox): - """ - AnchoredOffsetbox with DrawingArea - """ - + @docstring.dedent def __init__(self, width, height, xdescent, ydescent, loc, pad=0.4, borderpad=0.5, prop=None, frameon=True, **kwargs): """ - *width*, *height*, *xdescent*, *ydescent* : the dimensions of the DrawingArea. - *prop* : font property. This is only used for scaling the paddings. + An anchored container with a fixed size and fillable DrawingArea. + + Artists added to the *drawing_area* will have their coordinates + interpreted as pixels. Any transformations set on the artists will be + overridden. + + Parameters + ---------- + width, height : int or float + width and height of the container, in pixels. + + xdescent, ydescent : int or float + descent of the container in the x- and y- direction, in pixels. + + loc : int + Location of this artist. Valid location codes are:: + + 'upper right' : 1, + 'upper left' : 2, + 'lower left' : 3, + 'lower right' : 4, + 'right' : 5, + 'center left' : 6, + 'center right' : 7, + 'lower center' : 8, + 'upper center' : 9, + 'center' : 10 + + pad : int or float, optional + Padding around the child objects, in fraction of the font + size. Defaults to 0.4. + + borderpad : int or float, optional + Border padding, in fraction of the font size. + Defaults to 0.5. + + prop : `matplotlib.font_manager.FontProperties`, optional + Font property used as a reference for paddings. + + frameon : bool, optional + If True, draw a box around this artists. Defaults to True. + + **kwargs : + Keyworded arguments to pass to + :class:`matplotlib.offsetbox.AnchoredOffsetbox`. + + Attributes + ---------- + drawing_area : `matplotlib.offsetbox.DrawingArea` + A container for artists to display. + + Examples + -------- + To display blue and red circles of different sizes in the upper right + of an axes *ax*: + + >>> ada = AnchoredDrawingArea(20, 20, 0, 0, loc=1, frameon=False) + >>> ada.drawing_area.add_artist(Circle((10, 10), 10, fc="b")) + >>> ada.drawing_area.add_artist(Circle((30, 10), 5, fc="r")) + >>> ax.add_artist(ada) """ self.da = DrawingArea(width, height, xdescent, ydescent) self.drawing_area = self.da @@ -80,6 +135,7 @@ def __init__(self, transform, loc, Attributes ---------- drawing_area : `matplotlib.offsetbox.AuxTransformBox` + A container for artists to display. Examples -------- From abed7b6c51302f281935bbeddcf38034f9eb06c3 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Wed, 16 Dec 2015 12:29:07 -0500 Subject: [PATCH 7/9] Change incorrect import in simple_anchored_artists example Add explicit setting of __all__ to prevent similiar errors --- examples/axes_grid/simple_anchored_artists.py | 2 +- lib/mpl_toolkits/axes_grid1/anchored_artists.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/axes_grid/simple_anchored_artists.py b/examples/axes_grid/simple_anchored_artists.py index 466f1a1730cb..26ef0f6a26a8 100644 --- a/examples/axes_grid/simple_anchored_artists.py +++ b/examples/axes_grid/simple_anchored_artists.py @@ -2,7 +2,7 @@ def draw_text(ax): - from mpl_toolkits.axes_grid1.anchored_artists import AnchoredText + from matplotlib.offsetbox import AnchoredText at = AnchoredText("Figure 1a", loc=2, prop=dict(size=8), frameon=True, ) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 7c06042119aa..f7a27e6d7a7d 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -6,6 +6,9 @@ DrawingArea, TextArea, VPacker) from matplotlib.patches import Rectangle, Ellipse +__all__ = ['AnchoredDrawingArea', 'AnchoredAuxTransformBox', + 'AnchoredEllipse', 'AnchoredSizeBar'] + class AnchoredDrawingArea(AnchoredOffsetbox): @docstring.dedent From 52e754902e2dc0b60970c4fb5333e5b17426549f Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Wed, 16 Dec 2015 12:30:23 -0500 Subject: [PATCH 8/9] Build documentation for axes_grid1.anchored_artists --- doc/mpl_toolkits/axes_grid/api/anchored_artists_api.rst | 7 +++++++ doc/mpl_toolkits/axes_grid/api/index.rst | 1 + 2 files changed, 8 insertions(+) create mode 100644 doc/mpl_toolkits/axes_grid/api/anchored_artists_api.rst diff --git a/doc/mpl_toolkits/axes_grid/api/anchored_artists_api.rst b/doc/mpl_toolkits/axes_grid/api/anchored_artists_api.rst new file mode 100644 index 000000000000..4aeba4e3aaf6 --- /dev/null +++ b/doc/mpl_toolkits/axes_grid/api/anchored_artists_api.rst @@ -0,0 +1,7 @@ +:mod:`mpl_toolkits.axes_grid1.anchored_artists` +=============================================== + +.. automodule:: mpl_toolkits.axes_grid1.anchored_artists + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/mpl_toolkits/axes_grid/api/index.rst b/doc/mpl_toolkits/axes_grid/api/index.rst index 0e5975592c4b..672336ee2dbf 100644 --- a/doc/mpl_toolkits/axes_grid/api/index.rst +++ b/doc/mpl_toolkits/axes_grid/api/index.rst @@ -24,4 +24,5 @@ .. toctree:: + anchored_artists_api.rst inset_locator_api.rst From 34d19375ab2df56178803db349c22e68099bcb91 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Wed, 16 Dec 2015 12:34:42 -0500 Subject: [PATCH 9/9] Readd six import in axes_grid1.anchored_artists for consistency --- lib/mpl_toolkits/axes_grid1/anchored_artists.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index f7a27e6d7a7d..3d0650f0f8d0 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -2,6 +2,7 @@ unicode_literals) from matplotlib import docstring +from matplotlib.externals import six from matplotlib.offsetbox import (AnchoredOffsetbox, AuxTransformBox, DrawingArea, TextArea, VPacker) from matplotlib.patches import Rectangle, Ellipse