0

I'm getting a number of errors. Does anyone see something in the code that is sticking out like thorn?

from pylab import plot, show, title, xlabel, ylabel, legend
import matplotlib.dates as dates
title('AF16 compared to AF17')
xlabel('Month')
ylabel('Donation Amount')
legend([af16y, af17y])
af16x = dates.datestr2num[1/1/15,3/5/16]
af17x = dates.datestr2num[4/5/16, 2/2/17]
af16y = [3000,5000]
af17y = [350,7000]
plot(af16x,af16y,af17x,af17y)

mostly I know the legend and the dates are causing errors. This is a schmorgasborg of code so I knew I was running into errors. Any help is appreciated.

wvinyl
  • 84
  • 1
  • 9
  • 1
    What errors are you getting? – jtmingus Mar 06 '17 at 23:11
  • datestr2num is a function, which takes a list of string representations of dates. Take a look at http://stackoverflow.com/questions/23644020/matplotlib-string-to-dates – miah Mar 06 '17 at 23:52
  • I get an error pertaining to the legend: NameError: name 'af16y' is not defined I just comment out the legend and then I get this error: af16x = dates.datestr2num[1/1/15,3/15/16] TypeError: 'function' object is not subscriptable – wvinyl Mar 07 '17 at 06:20
  • anyone looking for help with this concept go here: http://stackoverflow.com/questions/9627686/plotting-dates-on-the-x-axis-with-pythons-matplotlib – wvinyl Mar 07 '17 at 06:49

0 Answers0