From: David H. <dav...@gm...> - 2006-08-01 02:42:33
|
Hi John, 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 |