BUG: barplot with log=True not working for values smaller than 1 · Issue #9905 · pandas-dev/pandas (original) (raw)
s = pd.Series([0.1, 0.01, 0.001], index=['a', 'b', 'c'])
s.plot(kind='bar', log=True)
TypeError Traceback (most recent call last)
<ipython-input-13-75b989d29042> in <module>()
1 s = pd.Series([0.1, 0.01, 0.001], index=['a', 'b', 'c'])
----> 2 s.plot(kind='bar', log=True)
C:\Anaconda\lib\site-packages\pandas\tools\plotting.pyc in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)
2517 yerr=yerr, xerr=xerr,
2518 label=label, secondary_y=secondary_y,
-> 2519 **kwds)
2520
2521
C:\Anaconda\lib\site-packages\pandas\tools\plotting.pyc in _plot(data, x, y, subplots, ax, kind, **kwds)
2323 plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
2324
-> 2325 plot_obj.generate()
2326 plot_obj.draw()
2327 return plot_obj.result
C:\Anaconda\lib\site-packages\pandas\tools\plotting.pyc in generate(self)
921 self._compute_plot_data()
922 self._setup_subplots()
--> 923 self._make_plot()
924 self._add_table()
925 self._make_legend()
C:\Anaconda\lib\site-packages\pandas\tools\plotting.pyc in _make_plot(self)
1884 w = self.bar_width / K
1885 rect = bar_f(ax, self.ax_pos + (i + 0.5) * w, y, w,
-> 1886 start=start, label=label, **kwds)
1887 self._add_legend_handle(rect, label, index=i)
1888
C:\Anaconda\lib\site-packages\pandas\tools\plotting.pyc in f(ax, x, y, w, start, **kwds)
1823 if self.kind == 'bar':
1824 def f(ax, x, y, w, start=None, **kwds):
-> 1825 start = start + self.bottom
1826 return ax.bar(x, y, w, bottom=start,log=self.log, **kwds)
1827 elif self.kind == 'barh':
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'