Is there a way to find all the "axes" objects or "line" object handles in
pylab? In matlab I used to do something like
A = findobj(gcf)
Allaxes = findall(a,'Type','axes')
Set(allaxes,'Fontname','Arial')
Is there a way to do that in pylab/matplotlib?
Thanks,
j
···
-----------------------------------
John Kitchin
Assistant Professor
NETL-IAES Resident Institute Fellow
Doherty Hall 3112
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu
Hello John,
I'm not sure there is a better way, but the following works for me:
···
--------------------------------------------------------------------------------------
from pylab import *
fig = figure()
# adding some subplots / axes instances
subplot(121)
x = linspace(-0.5, 1.5, 10)
plot(x, 0.5*x**2, 'ro', x, 0.33*x**3, 'bs')
for i in [2, 4]:
subplot(2,2,i)
# get all axes of the figure 'fig' ...
allaxes = fig.get_axes()
# ... and reset their property x-limits
setp(allaxes, 'xlim', (-.5, 1.5))
ax = allaxes[0]
# get all lines of the axes 'ax' ...
lines = ax.get_lines() # == ax.lines
# ... and reset their markerfacecolor
setp(lines, 'mfc', 'g')
show()
---------------------------------------------------------------------------------------
best regards
Matthias
On Thursday 26 June 2008 00:21:13 John Kitchin wrote:
Is there a way to find all the "axes" objects or "line" object handles in
pylab? In matlab I used to do something like
A = findobj(gcf)
Allaxes = findall(a,'Type','axes')
Set(allaxes,'Fontname','Arial')
Is there a way to do that in pylab/matplotlib?
Thanks,
j
-----------------------------------
John Kitchin
Assistant Professor
NETL-IAES Resident Institute Fellow
Doherty Hall 3112
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options