From: Joe K. <jki...@ge...> - 2014-02-05 23:08:10
|
On Wed, Feb 5, 2014 at 3:46 PM, Benjamin Root <ben...@ou...> wrote: > IIRC, you can use plt.setp() for this purpose: > http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.setp > > Essentially, anything that would come after the "set_" part of an object's > method can be a keyword. So, I think this would work: > plt.setp(ax, xlim=[-0.2, 0.9], ylim=[-100,100], zlim=[-0.3, 0.4]) > plt.setp(ax, xlabel='Time [$\mu$s]', ylabel='Bias [V]', > zlabel='Voltage[V]') > <snip> Just to elaborate on what Ben said, all matplotlib artists have a "set" method. E.g.: ax.set(xlim=[min, max], ylim=[min, max], xlabel='blah') "plt.setp" basically just calls "set", but it will also operate on sequences of artists. Therefore you can do things like: fig, axes = plt.subplots(nrows=2, ncols=2) plt.setp(axes.flat, aspect=2, ...) Some people prefer the "Tk-style" set method to using "setp" if you're operating on a single artist. Keep in mind that it also works for other artists, not just axes. At any rate, "setp" and the "set" method are certainly handy to know about! Cheers, -Joe |