From: John H. <jdh...@ac...> - 2006-01-05 01:51:05
|
>>>>> "Christian" == Christian Seberino <seb...@sp...> writes: Christian> I've notice that if I (1) create a plot vs. e.g. Christian> plot([1,2,3]) Christian> (2) explicitly add a plot to a Figure object Christian> e.g. fig = Figure() p = fig.add_subplot(111) Christian> plot([1,2,3]) Christian> it looks DIFFERENT?!? Not sure what your problem is: please post complete examples. But it looks like you are improperly mixing pylab and the OO API. If you want to use a minimal set of pylab and use OO matplotlib for every thing else, I recommend import matplotlib.numerix as nx from pylab import figure, show, close The first command lets pylab handle figure management, the most complex part, and the second gives you access to the numpy namespace Here is the equivalent of the canonical pylab : plot([1,2,3[) using a more pythonic style: from pylab import figure, show, close fig = figure() ax = fig.add_subplot(111) ax.plot([1,2,3]) show() Note in your example: fig = Figure() p = fig.add_subplot(111) plot([1,2,3]) You used fig.add_subplot to create an Axes, which you named "p", but then did not use it. You would have wanted something like p.plot([1,2,3]) JDH |