From: Goyo <goy...@gm...> - 2011-02-28 21:17:22
|
David, the preferred way to custom plots seems to be passing an Axes instance to the plotting function. Some tricks allow use of pylab/pyplot style: def custom_plot(x, y, axes=None): ... if axes is None: axes = pyplot.gca() axes.plot(x, y) .... What you don't get this way is the axes.custom_plot(x, y) sintax, which requires subclassing Axes. But doing this is not common and not straighforward if you want it to work well with pyplot.subplot() and the like. Maybe monkey patching would work but well, you know... I never tried it anyway. Goyo |