Thanks for taking the time to answer a badly formulated question. With your indications, I have been able to get an example working.
The point was that I had a function with a number of arguments that returned a subplot(111) instance. Inside this function there are thousands of calls to plot, there are labels and a title. I called the function from my main script, called savefig and stored the figure. Now I want to compare two such figures side by side, and ideally tweak the axes so they are identical.
Here is what I came up with your help:
def make_complicated_graph(x, sub = None):
s = sub or subplot(111)
s.plot(x)
s.set_title('test12')
s.set_xlabel('T')
s.set_ylabel('Y')
s.scatter([3,4], [5,2], s= 5, c='r')
if sub is None:
return s
fig = figure(1)
s1 = subplot(2,1,1)
s2 = subplot(2,1,2)
make_complicated_graph(arange(5), sub = s1)
make_complicated_graph(arange(10), sub = s2)
s1.set_xlim(s2.get_xlim())
show()
Thanks again for your help.
David
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users