# Buggy code
def _subplot_label(self, axis):
    layout_num = self.layout_num if self.subplot else 1
    if self.sublabel_format and not self.adjoined and layout_num > 0:
        from mpl_toolkits.axes_grid1.anchored_artists import AnchoredText

        labels = {}
        if "{Alpha}" in self.sublabel_format:
            labels["Alpha"] = int_to_alpha(layout_num - 1)
        elif "{alpha}" in self.sublabel_format:
            labels["alpha"] = int_to_alpha(layout_num - 1, upper=False)
        elif "{numeric}" in self.sublabel_format:
            labels["numeric"] = self.layout_num
        elif "{Roman}" in self.sublabel_format:
            labels["Roman"] = int_to_roman(layout_num)
        elif "{roman}" in self.sublabel_format:
            labels["roman"] = int_to_roman(layout_num).lower()
        at = AnchoredText(
            self.sublabel_format.format(**labels),
            loc=3,
            bbox_to_anchor=self.sublabel_position,
            frameon=False,
            prop=dict(size=self.sublabel_size, weight="bold"),
            bbox_transform=axis.transAxes,
        )
        at.patch.set_visible(False)
        axis.add_artist(at)
        sublabel = at.txt.get_children()[0]
        self.handles["sublabel"] = sublabel
        self.handles["bbox_extra_artists"] += [sublabel]


# Traceback (ImportError)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\IPython\core\formatters.py in __call__(self, obj)
330                 pass
331             else:
--> 332                 return printer(obj)
333             # Finally look for special method names
334             method = get_real_method(obj, self.print_method)

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in pprint_display(obj)
257     if not ip.display_formatter.formatters['text/plain'].pprint:
258         return None
--> 259     return display(obj, raw=True)
260
261

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in display(obj, raw, **kwargs)
240     elif isinstance(obj, (Layout, NdLayout, AdjointLayout)):
241         with option_state(obj):
--> 242             html = layout_display(obj)
243     elif isinstance(obj, (HoloMap, DynamicMap)):
244         with option_state(obj):

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in wrapped(element)
129         try:
130             html = fn(element,
--> 131                       max_frames=OutputSettings.options['max_frames'])
132
133             # Only want to add to the archive for one display hook...

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in layout_display(layout, max_frames)
211         return None
212
--> 213     return render(layout)
214
215

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\ipython\display_hooks.py in render(obj, **kwargs)
59     if renderer.fig == 'pdf':
60         renderer = renderer.instance(fig='png')
---> 61     return renderer.html(obj, **kwargs)
62
63

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\renderer.py in html(self, obj, fmt, css, comm, **kwargs)
253         code to initialize a Comm, if the plot supplies one.
254         """
--> 255         plot, fmt =  self._validate(obj, fmt)
256         figdata, _ = self(plot, fmt, **kwargs)
257         if css is None: css = self.css

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\renderer.py in _validate(self, obj, fmt)
189         if isinstance(obj, tuple(self.widgets.values())):
190             return obj, 'html'
--> 191         plot = self.get_plot(obj, renderer=self)
192
193         fig_formats = self.mode_formats['fig'][self.mode]

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\renderer.py in get_plot(self_or_cls, obj, renderer)
176             plot = self_or_cls.plotting_class(obj)(obj, renderer=renderer,
177                                                    **plot_opts)
--> 178             plot.update(0)
179         else:
180             plot = obj

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in update(self, key)
242     def update(self, key):
243         if len(self) == 1 and key == 0 and not self.drawn:
--> 244             return self.initialize_plot()
245         return self.__getitem__(key)
246

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in wrapper(self, *args, **kwargs)
41     def wrapper(self, *args, **kwargs):
42         with _rc_context(self.fig_rcparams):
---> 43             return f(self, *args, **kwargs)
44     return wrapper
45

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in initialize_plot(self)
1069         ranges = self.compute_ranges(self.layout, key, None)
1070         for subplot in self.subplots.values():
-> 1071             subplot.initialize_plot(ranges=ranges)
1072
1073         # Create title handle

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in wrapper(self, *args, **kwargs)
41     def wrapper(self, *args, **kwargs):
42         with _rc_context(self.fig_rcparams):
---> 43             return f(self, *args, **kwargs)
44     return wrapper
45

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in initialize_plot(self, ranges)
639                 ax.set_axis_off()
640                 continue
--> 641             subplot.initialize_plot(ranges=ranges)
642
643         self.adjust_positions()

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in wrapper(self, *args, **kwargs)
41     def wrapper(self, *args, **kwargs):
42         with _rc_context(self.fig_rcparams):
---> 43             return f(self, *args, **kwargs)
44     return wrapper
45

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\element.py in initialize_plot(self, ranges)
490
491         return self._finalize_axis(self.keys[-1], element=element, ranges=ranges,
--> 492                                    **axis_kwargs)
493
494

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\element.py in _finalize_axis(self, key, element, title, dimensions, ranges, xticks, yticks, zticks, xlabel, ylabel, zlabel)
168
169             # Apply subplot label
--> 170             self._subplot_label(axis)
171
172             # Apply axis options if axes are enabled

C:\WinPython\basedir35\buildQt5\winpython-64bit-3.5.x.1\python-3.5.4.amd64\lib\site-packages\holoviews\plotting\mpl\plot.py in _subplot_label(self, axis)
181         layout_num = self.layout_num if self.subplot else 1
182         if self.sublabel_format and not self.adjoined and layout_num > 0:
--> 183             from mpl_toolkits.axes_grid1.anchored_artists import AnchoredText
184             labels = {}
185             if '{Alpha}' in self.sublabel_format:

ImportError: cannot import name 'AnchoredText'

# Fixed code
def _subplot_label(self, axis):
    layout_num = self.layout_num if self.subplot else 1
    if self.sublabel_format and not self.adjoined and layout_num > 0:
        from matplotlib.offsetbox import AnchoredText

        labels = {}
        if "{Alpha}" in self.sublabel_format:
            labels["Alpha"] = int_to_alpha(layout_num - 1)
        elif "{alpha}" in self.sublabel_format:
            labels["alpha"] = int_to_alpha(layout_num - 1, upper=False)
        elif "{numeric}" in self.sublabel_format:
            labels["numeric"] = self.layout_num
        elif "{Roman}" in self.sublabel_format:
            labels["Roman"] = int_to_roman(layout_num)
        elif "{roman}" in self.sublabel_format:
            labels["roman"] = int_to_roman(layout_num).lower()
        at = AnchoredText(
            self.sublabel_format.format(**labels),
            loc=3,
            bbox_to_anchor=self.sublabel_position,
            frameon=False,
            prop=dict(size=self.sublabel_size, weight="bold"),
            bbox_transform=axis.transAxes,
        )
        at.patch.set_visible(False)
        axis.add_artist(at)
        sublabel = at.txt.get_children()[0]
        self.handles["sublabel"] = sublabel
        self.handles["bbox_extra_artists"] += [sublabel]