The matplotlib plotting support of pint as shown in the documentation is more or less working (cf. hgrecco/pint#760 - remove the axhline and axvline calls to get it working), however if a pandas dataframe is created using a PintArray as show in the docs, there is another issue:
plt.plot('length', data=df)
Anyway, thanks for your great work! I really appreciate using pint in my projects.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-86-98a16b4be98e> in <module>
8 "width" : PA_([2,3], dtype="pint[m]")
9 })
---> 10 df.plot()
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\pandas\plotting\_core.py in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
2937 fontsize=fontsize, colormap=colormap, table=table,
2938 yerr=yerr, xerr=xerr, secondary_y=secondary_y,
-> 2939 sort_columns=sort_columns, **kwds)
2940 __call__.__doc__ = plot_frame.__doc__
2941
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\pandas\plotting\_core.py in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
1968 yerr=yerr, xerr=xerr,
1969 secondary_y=secondary_y, sort_columns=sort_columns,
-> 1970 **kwds)
1971
1972
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\pandas\plotting\_core.py in _plot(data, x, y, subplots, ax, kind, **kwds)
1796 plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
1797
-> 1798 plot_obj.generate()
1799 plot_obj.draw()
1800 return plot_obj.result
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\pandas\plotting\_core.py in generate(self)
247 def generate(self):
248 self._args_adjust()
--> 249 self._compute_plot_data()
250 self._setup_subplots()
251 self._make_plot()
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\pandas\plotting\_core.py in _compute_plot_data(self)
362 if is_empty:
363 raise TypeError('Empty {0!r}: no numeric data to '
--> 364 'plot'.format(numeric_data.__class__.__name__))
365
366 self.data = numeric_data
TypeError: Empty 'DataFrame': no numeric data to plot
IndexError Traceback (most recent call last)
<ipython-input-80-1c9c8127f2cc> in <module>
----> 1 plt.plot('length', data=df)
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\matplotlib\pyplot.py in plot(scalex, scaley, data, *args, **kwargs)
2809 return gca().plot(
2810 *args, scalex=scalex, scaley=scaley, **({"data": data} if data
-> 2811 is not None else {}), **kwargs)
2812
2813
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\matplotlib\__init__.py in inner(ax, data, *args, **kwargs)
1808 "the Matplotlib list!)" % (label_namer, func.__name__),
1809 RuntimeWarning, stacklevel=2)
-> 1810 return func(ax, *args, **kwargs)
1811
1812 inner.__doc__ = _add_data_doc(inner.__doc__,
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\matplotlib\axes\_axes.py in plot(self, scalex, scaley, *args, **kwargs)
1609 kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
1610
-> 1611 for line in self._get_lines(*args, **kwargs):
1612 self.add_line(line)
1613 lines.append(line)
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\matplotlib\axes\_base.py in _grab_next_args(self, *args, **kwargs)
391 this += args[0],
392 args = args[1:]
--> 393 yield from self._plot_args(this, kwargs)
394
395
D:\WinPython-64bit-3.7.2.0\python-3.7.2.amd64\lib\site-packages\matplotlib\axes\_base.py in _plot_args(self, tup, kwargs)
376 func = self._makefill
377
--> 378 ncx, ncy = x.shape[1], y.shape[1]
379 if ncx > 1 and ncy > 1 and ncx != ncy:
380 cbook.warn_deprecated("2.2", "cycling among columns of inputs "
IndexError: tuple index out of range