<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks a lot Nathan … I think I can  make due by generating separate plots and then pasting them together manually.<div class=""><br class=""></div><div class="">Good to know that it wasn’t something dumb I was doing :)</div><div class=""><br class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><i class=""><font size="3" class="">Cheers!</font></i></div><div class=""><i class=""><font size="3" class=""><br class=""></font></i></div><div class=""><i class=""><font size="3" class="">Rick Sarmento</font></i></div><div style="color: rgb(0, 0, 0); font-size: 13px;" class="">SESE Astronomy/Astrophysics Grad Student</div><div style="color: rgb(0, 0, 0); font-size: 13px;" class=""><a href="mailto:rsarment@asu.edu" class="">rsarment@asu.edu</a></div><div style="color: rgb(0, 0, 0);" class=""><br class=""></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Nov 4, 2014, at 11:34 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" class="">nathan12343@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hey Rick,<br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Nov 4, 2014 at 9:21 PM, Rick Sarmento<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:rsarment@asu.edu" target="_blank" class="">rsarment@asu.edu</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="auto" class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Hello all,<div class=""><br class=""></div><div class="">I’m having trouble getting yt to plot 2 gas-phase diagrams side-by-side in a grid. I can do this fine for a projection plot, phase plots seems to behave differently. Here’s the code — any idea how to get these two plots side by side sharing the same scale/color-bar?</div><div class=""><br class=""></div><blockquote style="margin: 0px 0px 0px 40px; border: medium none; padding: 0px;" class=""><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class=""># fractional=True keyword -- divide the profile data by the sum. </span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">fns = [ "/Users/earnric/RAMSES-Data/coolingFixedTau/output_00010/info_00010.txt",</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">       "/Users/earnric/RAMSES-Data/noCool/output_00010/info_00010.txt"]</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class=""><br class=""></span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">fig = plt.figure()</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">grid = AxesGrid(fig, (0.075,0.075,0.85,0.85),</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>nrows_ncols = (1, 2),</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>axes_pad = 0.05,</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>label_mode = "L",</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>share_all = True,</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>cbar_location="right",</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>cbar_mode="single",</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>cbar_size="3%",</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">               <span class="Apple-converted-space"> </span>cbar_pad="0%")</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">fig.suptitle("Gas Phase")</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class=""><br class=""></span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">for i, fn in enumerate(fns):</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>ds = yt.load(fn)</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>ad = ds.all_data()</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>p = yt.PhasePlot(ad, "density", "temperature", "cell_mass", x_bins=256, y_bins=256, weight_field=None, fractional=True )</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>plot = p.plots['cell_mass']</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>if i % 2 == 0:</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">       <span class="Apple-converted-space"> </span>ptype = "Gas phase ${H_2}$ cooling "</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>else:</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">       <span class="Apple-converted-space"> </span>ptype = "Gas phase Standard cooling "</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>zStr = ptype + "z = %.1f" % ds.current_redshift </span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>plot.figure = fig</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>plot.axes = grid[i].axes</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>plot.cax = grid.cbar_axes[i]</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>#plot.annotate_title(zStr) # YOU HAVE TO DO THIS AFTER THE AXES calls</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class=""><br class=""></span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>p['cell_mass'].axes.set_ylim (1e-1, 1e6)</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>p['cell_mass'].axes.set_xlim (1e-29, 1e-24)</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">   <span class="Apple-converted-space"> </span>p['cell_mass'].axes.set_title(zStr, fontsize=20)</span></font></div></div></div><div class=""><div class=""><div class=""><font face="Courier New" class=""><span style="font-size: 12px;" class="">p.show()</span></font></div></div></div></blockquote></div></div></blockquote><div class=""><br class=""></div><div class="">FWIW, this is the first I've ever heard someone trying to do this. I can confirm that it doesn't work.<br class=""></div><div class=""><br class=""></div><div class="">I tried experimenting a bit and unfortunately I think you're running into a limitation of matplotlib: AxesGrid doesn't support logarithmic x and y axes.<br class=""><br class=""></div><div class="">I can get something sort of sensible if I specify linear x and y axes and manually adjust the aspect ratio, but I don't think this is a particularly sustainable solution for supporting these sorts of plots:<span class="Apple-converted-space"> </span><br class=""><br class=""><a href="http://nbviewer.ipython.org/gist/ngoldbaum/ab71b48bd42e8c2a5b42" target="_blank" class="">http://nbviewer.ipython.org/gist/ngoldbaum/ab71b48bd42e8c2a5b42</a><br class=""><br class=""></div><div class="">Unfortunately when I try to make the same plot using logarithmic axes, I get junk:<br class=""><br class=""><a href="http://nbviewer.ipython.org/gist/ngoldbaum/821e44612f53eae830d8" class="">http://nbviewer.ipython.org/gist/ngoldbaum/821e44612f53eae830d8</a><br class=""></div><div class=""><br class=""></div><div class="">I think the most straightforward way to do this would be to do it 100% manually (outside of PhasePlot) using a Profile2D object and matplotlib.  If you figure out something that works for you I think it would be a good addition for the cookbook.<span class="Apple-converted-space"> </span><br class=""><br class="">It might be possible to use PhasePlot with a hand-constructured set of axes, but I've never tried to set that up so I'm not sure if you'll need to modify yt to get it to work.<br class=""><br class=""></div><div class="">Sorry I don't have better news for you - good luck with getting this plot working.<br class=""><br class=""></div><div class="">-Nathan<br class=""></div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="auto" class=""><div class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-size: 15px;" class=""><i class="">Cheers,</i></div><div style="font-size: 15px;" class=""><i class=""><br class=""></i></div><div style="font-size: 15px;" class=""><i class="">Rick Sarmento</i></div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""></div><br class=""><br class=""></div><br class=""></div></div></div><br class="">_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" target="_blank" class="">yt-users@lists.spacepope.org</a><br class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class=""><br class=""></blockquote></div><br class=""></div></div><span style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">yt-users mailing list</span><br style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:yt-users@lists.spacepope.org" style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">yt-users@lists.spacepope.org</a><br style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div></blockquote></div><br class=""></div></body></html>