title: Simple Django Graph example using matplotlib
body: <p>I'm looking for a very simple example of taking a Django QuerySet and then generating a graph using matplotlib. All the examples I've found have hard-coded data values or they don't really explain what they are doing. I thought this would be a good question for others as well. </p>
  
  <p>Let me set the stage with a very simple example so this is very easy to follow for me and for other n00bs. ;-)</p>
  
  <pre><code>class Animals(models.Model):
      cats = models.PositiveSmallIntegerField
      dogs = models.PositiveSmallIntegerField
      created = created = models.DateTimeField(auto_now_add=True)
  
  datatograph = Animals.objects.all()
  </code></pre>
  
  <p>How do I get datatograph into the right format so I can pass it to matplotlib and end up with two an X axis of integers, y axis of dates and a line for dogs and a line for cats.</p>
  
  <p>Thank you!</p>