Problem with

Using matplotlib 0.84, python 2.4, scipy 0.3.2, numeric 23.7

I get errors when running

Since the demo scripts are for educational purposes and primarily used by newbies, I have a couple of suggestions.

1. Don't use import *, import the specific functions used in the demo. I've had problems with this (especially in the interpreter) because many Python modules use the same names in their global name space and it's easy to inadvertently replace one function with another of the same name which introduces bugs that can be difficult to find.

2. Don't import functions from submodules, instead use the submodule name when calling the function. It makes it much clearer to see where the function came from.

The set function seems to be broken (or it's a typo), I had to replace it with the setp function to get the demo to run.

Below it the results of diff between my working version of the demo and the original that won't run:


wjd@...873... ~/test $ diff ../matplotlib_examples/

< from pylab import dates, YEARLY, drange, rand, subplot, plot_date, setp, show
> from pylab import *
> from matplotlib.dates import YEARLY, DateFormatter, \
> rrulewrapper, RRuleLocator, drange
< rule = dates.rrulewrapper(YEARLY, byeaster=1, interval=5)
< loc = dates.RRuleLocator(rule)
< formatter = dates.DateFormatter('%m/%d/%y')
> rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
> loc = RRuleLocator(rule)
> formatter = DateFormatter('%m/%d/%y')
< setp(labels, rotation=30, fontsize=10)
> set(labels, rotation=30, fontsize=10)