From: Abraham S. <ab...@cn...> - 2005-07-08 02:12:11
|
Hi. I just installed the newest version of matplotlib (0.82), and discovered all my subplots were ending on top of each other. After going through my code and verifying everything looked okay, I tried a simple: subplot(2, 1, 1); plot(range(0, 10)); subplot(2, 2, 2); plot(range(0, 10)) and still only got one subplot. I went to the matplotlib code, and after some prodding, discovered that all the keys for the _seen map were exactly the same. Going to the _make_key function revealed that my use of subplot (i.e. three seperate arguments), was not working. Here is a fix that seems to work for me: (int _make_key function): if iterable(args[0]): key = tuple(args[0]), tuple( fixitems(kwargs.items())) ## NEW elif len(args) > 1: key = args, tuple( fixitems(kwargs.items())) ## \NEW else: key = args[0], tuple(fixitems( kwargs.items())) Abe |