---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib_inline/backend_inline.py:126, in flush_figures()
123 if InlineBackend.instance().close_figures:
124 # ignore the tracking, just draw and close all figures
125 try:
--> 126 return show(True)
127 except Exception as e:
128 # safely show traceback if in IPython, else raise
129 ip = get_ipython()
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib_inline/backend_inline.py:90, in show(close, block)
88 try:
89 for figure_manager in Gcf.get_all_fig_managers():
---> 90 display(
91 figure_manager.canvas.figure,
92 metadata=_fetch_figure_metadata(figure_manager.canvas.figure)
93 )
94 finally:
95 show._to_draw = []
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/display_functions.py:298, in display(include, exclude, metadata, transient, display_id, raw, clear, *objs, **kwargs)
296 publish_display_data(data=obj, metadata=metadata, **kwargs)
297 else:
--> 298 format_dict, md_dict = format(obj, include=include, exclude=exclude)
299 if not format_dict:
300 # nothing to display (e.g. _ipython_display_ took over)
301 continue
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/formatters.py:179, in DisplayFormatter.format(self, obj, include, exclude)
177 md = None
178 try:
--> 179 data = formatter(obj)
180 except:
181 # FIXME: log the exception
182 raise
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/formatters.py:223, in catch_format_error(method, self, *args, **kwargs)
221 """show traceback on failed format call"""
222 try:
--> 223 r = method(self, *args, **kwargs)
224 except NotImplementedError:
225 # don't warn on NotImplementedErrors
226 return self._check_return(None, args[0])
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/formatters.py:340, in BaseFormatter.__call__(self, obj)
338 pass
339 else:
--> 340 return printer(obj)
341 # Finally look for special method names
342 method = get_real_method(obj, self.print_method)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/IPython/core/pylabtools.py:152, in print_figure(fig, fmt, bbox_inches, base64, **kwargs)
149 from matplotlib.backend_bases import FigureCanvasBase
150 FigureCanvasBase(fig)
--> 152 fig.canvas.print_figure(bytes_io, **kw)
153 data = bytes_io.getvalue()
154 if fmt == 'svg':
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py:2178, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
2176 if bbox_inches:
2177 if bbox_inches == "tight":
-> 2178 bbox_inches = self.figure.get_tightbbox(
2179 renderer, bbox_extra_artists=bbox_extra_artists)
2180 if (isinstance(layout_engine, ConstrainedLayoutEngine) and
2181 pad_inches == "layout"):
2182 h_pad = layout_engine.get()["h_pad"]
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/_api/deprecation.py:457, in make_keyword_only.<locals>.wrapper(*args, **kwargs)
451 if len(args) > name_idx:
452 warn_deprecated(
453 since, message="Passing the %(name)s %(obj_type)s "
454 "positionally is deprecated since Matplotlib %(since)s; the "
455 "parameter will become keyword-only %(removal)s.",
456 name=name, obj_type=f"parameter of {func.__name__}()")
--> 457 return func(*args, **kwargs)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/figure.py:1787, in FigureBase.get_tightbbox(self, renderer, bbox_extra_artists)
1783 if ax.get_visible():
1784 # some Axes don't take the bbox_extra_artists kwarg so we
1785 # need this conditional....
1786 try:
-> 1787 bbox = ax.get_tightbbox(
1788 renderer, bbox_extra_artists=bbox_extra_artists)
1789 except TypeError:
1790 bbox = ax.get_tightbbox(renderer)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/_api/deprecation.py:457, in make_keyword_only.<locals>.wrapper(*args, **kwargs)
451 if len(args) > name_idx:
452 warn_deprecated(
453 since, message="Passing the %(name)s %(obj_type)s "
454 "positionally is deprecated since Matplotlib %(since)s; the "
455 "parameter will become keyword-only %(removal)s.",
456 name=name, obj_type=f"parameter of {func.__name__}()")
--> 457 return func(*args, **kwargs)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axes/_base.py:4482, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
4480 for axis in self._axis_map.values():
4481 if self.axison and axis.get_visible():
-> 4482 ba = martist._get_tightbbox_for_layout_only(axis, renderer)
4483 if ba:
4484 bb.append(ba)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/artist.py:1408, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
1402 """
1403 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1404 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
1405 when encountering third-party subclasses that do not support it.
1406 """
1407 try:
-> 1408 return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
1409 except TypeError:
1410 return obj.get_tightbbox(*args, **kwargs)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axis.py:1371, in Axis.get_tightbbox(self, renderer, for_layout_only)
1368 renderer = self.figure._get_renderer()
1369 ticks_to_draw = self._update_ticks()
-> 1371 self._update_label_position(renderer)
1373 # go back to just this axis's tick labels
1374 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axis.py:2410, in XAxis._update_label_position(self, renderer)
2408 try:
2409 spine = self.axes.spines['bottom']
-> 2410 spinebbox = spine.get_window_extent()
2411 except KeyError:
2412 # use Axes if spine doesn't exist
2413 spinebbox = self.axes.bbox
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/spines.py:158, in Spine.get_window_extent(self, renderer)
156 return bb
157 bboxes = [bb]
--> 158 drawn_ticks = self.axis._update_ticks()
160 major_tick = next(iter({*drawn_ticks} & {*self.axis.majorTicks}), None)
161 minor_tick = next(iter({*drawn_ticks} & {*self.axis.minorTicks}), None)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axis.py:1306, in Axis._update_ticks(self)
1304 tick.label1.set_text(label)
1305 tick.label2.set_text(label)
-> 1306 minor_locs = self.get_minorticklocs()
1307 minor_labels = self.minor.formatter.format_ticks(minor_locs)
1308 minor_ticks = self.get_minor_ticks(len(minor_locs))
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/axis.py:1535, in Axis.get_minorticklocs(self)
1533 """Return this Axis' minor tick locations in data coordinates."""
1534 # Remove minor ticks duplicating major ticks.
-> 1535 minor_locs = np.asarray(self.minor.locator())
1536 if self.remove_overlapping_locs:
1537 major_locs = self.major.locator()
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/plotting/_matplotlib/converter.py:1001, in TimeSeries_DateLocator.__call__(self)
999 vmin, vmax = vmax, vmin
1000 if self.isdynamic:
-> 1001 locs = self._get_default_locs(vmin, vmax)
1002 else: # pragma: no cover
1003 base = self.base
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/plotting/_matplotlib/converter.py:986, in TimeSeries_DateLocator._get_default_locs(self, vmin, vmax)
984 def _get_default_locs(self, vmin, vmax):
985 """Returns the default locations of ticks."""
--> 986 locator = self.finder(vmin, vmax, self.freq)
988 if self.isminor:
989 return np.compress(locator["min"], locator["val"])
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/plotting/_matplotlib/converter.py:732, in _daily_finder(vmin, vmax, freq)
730 elif span <= 1.15 * periodsperyear:
731 year_start = _period_break(dates_, "year")
--> 732 month_start = _period_break(dates_, "month")
733 week_start = _period_break(dates_, "week")
734 info_maj[month_start] = True
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/plotting/_matplotlib/converter.py:525, in _period_break(dates, period)
514 def _period_break(dates: PeriodIndex, period: str) -> npt.NDArray[np.intp]:
515 """
516 Returns the indices where the given period changes.
517
(...)
523 Name of the period to monitor.
524 """
--> 525 mask = _period_break_mask(dates, period)
526 return np.nonzero(mask)[0]
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/plotting/_matplotlib/converter.py:531, in _period_break_mask(dates, period)
529 def _period_break_mask(dates: PeriodIndex, period: str) -> npt.NDArray[np.bool_]:
530 current = getattr(dates, period)
--> 531 previous = getattr(dates - 1 * dates.freq, period)
532 return current != previous
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/core/indexes/extension.py:68, in _inherit_from_data.<locals>.fget(self)
67 def fget(self):
---> 68 result = getattr(self._data, name)
69 if wrap:
70 if isinstance(result, type(self._data)):
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pandas/core/arrays/period.py:111, in _field_accessor.<locals>.f(self)
109 def f(self):
110 base = self.dtype._dtype_code
--> 111 result = get_period_field_arr(name, self.asi8, base)
112 return result
KeyboardInterrupt: