On Wed, Feb 5, 2014 at 3:46 PM, Benjamin Root <ben.r...@ou.edu> 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
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to