Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Elizabeth HarperClark <hclark@as...>  20110404 20:58:49

From: Elizabeth HarperClark <hclark@ci...>  20110404 21:01:01

From: Elizabeth HarperClark <hclark@ci...>  20110404 21:50:11
Attachments:
Message as HTML

Hello, I've been playing with the script and I now know a little bit more about what is wrong. I can get the full graph space to plot by changing: ax_mass = SubplotHost(fig, 1,1,1, aspect=1.) to ax_mass = SubplotHost(fig, 1,1,1) but then a line is never drawn. I have removed the x and y axis limits and it plots the axes for the limits of the date but no line for the graph? Here is the relevant part of the code: fig = plt.figure() ax_mass = SubplotHost(fig, 1,1,1) frac_to_mass = gasmass print 'frac_to_mass', frac_to_mass aux_trans = mtransforms.Affine2D().scale(1., frac_to_mass) ax_frac = ax_mass.twin(aux_trans) ax_frac.set_viewlim_mode("transform") fig.add_subplot(ax_mass) ax_mass.plot(time,massesMsun, linestyle='', color='k', linewidth=2.0) ax_mass.axis["bottom"].set_label("Time (Myrs)" ) ax_frac.axis["right"].set_label("Fraction of Original Gas Mass in Stars" ) ax_mass.axis["left"].set_label("Mass in Stars (Msun)" ) ax_frac.axis["right"].major_ticklabels.set_visible(True) ax_frac.axis["top"].major_ticklabels.set_visible(False) plt.savefig(frame_template %(folder,name[0],name[int(sys.argv[1])1]), format="eps") can I not use ax_mass.plot? Thanks, Libby On 4 April 2011 17:00, Elizabeth HarperClark <hclark@...>wrote: > Hi guys, > > I am trying to use the Axes grid toolkit to plot a graph with a second y > axes that gives the first y axes in different units (similar to > http://matplotlib.sourceforge.net/examples/axes_grid/parasite_simple2.html?highlight=subplothost). > I am clearly getting something wrong or missing something as I get both y > axes but no graph inbetween. Plot and script attached. Please can anyone see > what I have got wrong or point me in the direction of more extensive > documentation about parasite axes or SubplotHost? > > Many thanks, > > Libby > > >  > Elizabeth HarperClark MA MSci > PhD Candidate, Astrophysics, UofT > > > http://www.astro.utoronto.ca/~hclark <http://www.astro.utoronto.ca/%7Ehclark>; > hclark@... > AIM: edphc1 > MSN: edphc1@... > Skype: eharperclark > Office phone: 4169785759 >  Elizabeth HarperClark MA MSci PhD Candidate, Astrophysics, UofT http://www.astro.utoronto.ca/~hclark <http://www.astro.utoronto.ca/%7Ehclark>; hclark@... AIM: edphc1 MSN: edphc1@... Skype: eharperclark Office phone: 4169785759 
From: Elizabeth HarperClark <hclark@ci...>  20110404 22:20:55
Attachments:
Message as HTML

Sorry for another email, Please all ignore my previous emails, I have figured it out and it was a stupid error on my part plotting time rather than time[0] etc. Apologies and best wishes, Libby On 4 April 2011 17:50, Elizabeth HarperClark <hclark@...>wrote: > Hello, > > I've been playing with the script and I now know a little bit more about > what is wrong. I can get the full graph space to plot by changing: > > ax_mass = SubplotHost(fig, 1,1,1, aspect=1.) > to > ax_mass = SubplotHost(fig, 1,1,1) > > but then a line is never drawn. I have removed the x and y axis limits and > it plots the axes for the limits of the date but no line for the graph? Here > is the relevant part of the code: > > fig = plt.figure() > ax_mass = SubplotHost(fig, 1,1,1) > > frac_to_mass = gasmass > print 'frac_to_mass', frac_to_mass > aux_trans = mtransforms.Affine2D().scale(1., frac_to_mass) > ax_frac = ax_mass.twin(aux_trans) > ax_frac.set_viewlim_mode("transform") > > fig.add_subplot(ax_mass) > ax_mass.plot(time,massesMsun, linestyle='', color='k', linewidth=2.0) > > ax_mass.axis["bottom"].set_label("Time (Myrs)" ) > ax_frac.axis["right"].set_label("Fraction of Original Gas Mass in Stars" ) > ax_mass.axis["left"].set_label("Mass in Stars (Msun)" ) > ax_frac.axis["right"].major_ticklabels.set_visible(True) > ax_frac.axis["top"].major_ticklabels.set_visible(False) > plt.savefig(frame_template %(folder,name[0],name[int(sys.argv[1])1]), > format="eps") > > > can I not use ax_mass.plot? > > Thanks, > > Libby > > > > > > > On 4 April 2011 17:00, Elizabeth HarperClark <hclark@...>wrote: > >> Hi guys, >> >> I am trying to use the Axes grid toolkit to plot a graph with a second y >> axes that gives the first y axes in different units (similar to >> http://matplotlib.sourceforge.net/examples/axes_grid/parasite_simple2.html?highlight=subplothost). >> I am clearly getting something wrong or missing something as I get both y >> axes but no graph inbetween. Plot and script attached. Please can anyone see >> what I have got wrong or point me in the direction of more extensive >> documentation about parasite axes or SubplotHost? >> >> Many thanks, >> >> Libby >> >> >>  >> Elizabeth HarperClark MA MSci >> PhD Candidate, Astrophysics, UofT >> >> >> http://www.astro.utoronto.ca/~hclark <http://www.astro.utoronto.ca/%7Ehclark>; >> hclark@... >> AIM: edphc1 >> MSN: edphc1@... >> Skype: eharperclark >> Office phone: 4169785759 >> > > > >  > Elizabeth HarperClark MA MSci > PhD Candidate, Astrophysics, UofT > > http://www.astro.utoronto.ca/~hclark <http://www.astro.utoronto.ca/%7Ehclark>; > hclark@... > AIM: edphc1 > MSN: edphc1@... > Skype: eharperclark > Office phone: 4169785759 >  Elizabeth HarperClark MA MSci PhD Candidate, Astrophysics, UofT http://www.astro.utoronto.ca/~hclark <http://www.astro.utoronto.ca/%7Ehclark>; hclark@... AIM: edphc1 MSN: edphc1@... Skype: eharperclark Office phone: 4169785759 