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.

4
  • 1
    What errors are you getting? Commented Mar 6, 2017 at 23:11
  • datestr2num is a function, which takes a list of string representations of dates. Take a look at stackoverflow.com/questions/23644020/matplotlib-string-to-dates Commented Mar 6, 2017 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 Commented Mar 7, 2017 at 6:20
  • anyone looking for help with this concept go here: stackoverflow.com/questions/9627686/… Commented Mar 7, 2017 at 6:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.