You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prettyplotlib seems to choke when the values provided on the x-axis do not support the + operator (or the "width" value does not support the / operator). My code is excerpted below. ppl.bar throws a TypeError, but ppl.plot works wonderfully.
dates = sorted(review_by_date.keys())
review_counts = [review_by_date[k] for k in x]
ma = moving_average(review_counts, 10)
fig, axes = plt.subplots(1, figsize=(16, 10))
ppl.bar(axes, dates, review_counts, annotate=False, linewidth=0)
axes.bar(dates, review_counts, color='green', linewidth=0) # TypeError
# axes.plot(dates, ma, 'r')
ppl.plot(axes, dates, ma) # Works
fig.autofmt_xdate()
axes.set_title('Reviews by Date')
axes.set_xlabel('Dates')
axes.set_ylabel('Reviews')
axes.fmt_xdata = mdates.DateFormatter('%Y-%m-%d')
...
prettyplotlib/_bar.pyc in bar(*args, **kwargs)
48 xtickabels = kwargs.pop('xticklabels', None)
49 # left+0.4 is the center of the bar
---> 50 xticks = np.array(left) + middle
51
52 # Whether or not to annotate each bar with the height value
TypeError: unsupported operand type(s) for +: 'datetime.date' and 'float'
The text was updated successfully, but these errors were encountered:
prettyplotlib seems to choke when the values provided on the x-axis do not support the + operator (or the "width" value does not support the / operator). My code is excerpted below. ppl.bar throws a TypeError, but ppl.plot works wonderfully.
...
The text was updated successfully, but these errors were encountered: