<div dir="ltr"><div><span style="white-space:pre-wrap">   </span>for verts in slc.ds.grid_lines:</div><div><span style="white-space:pre-wrap">          </span>grid_collection = PolyCollection(verts, facecolors="none", edgecolors=(1.0,1.0,1.0,0.2),linewidth=0.1)</div><div><span style="white-space:pre-wrap">         </span>grid[gridid].axes.add_collection(grid_collection)</div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-14 15:50 GMT+02:00 Tim-Eric Rathjen <span dir="ltr"><<a href="mailto:rathjen@ph1.uni-koeln.de" target="_blank">rathjen@ph1.uni-koeln.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div><br></div><div>===================================</div><div>Tim-Eric Rathjen</div><div>I. Physikalisches Institut</div><div>Universität zu Köln</div><div>Universitätsstr. 22</div><div>50937 Köln</div><div>Germany</div><div>email: <a href="mailto:rathjen@ph1.uni-koeln.de" target="_blank">rathjen@ph1.uni-koeln.de</a></div><div>phone: +49 (0) 221 470 8352</div></div></div></div></div></div>
<div dir="ltr">Hi,<br>
I'm trying to do some kind of a multiplot using yt and the .annotate_grids()-function provided with yt.<br>
<br>
My code looks like this:<br>
<br>
import yt<br>
import matplotlib.pyplot as plt<br>
from mpl_toolkits.axes_grid1 import AxesGrid<br>
<br>
fns = ['turb_vrms10_n3_pm__hdf5_plt_cnt_0200', 'turb_vrms10_n3_pm__hdf5_plt_cnt_0300']<br>
<br>
fig = plt.figure()<br>
<br>
# See <a href="http://matplotlib.org/mpl_toolkits/axes_grid/api/axes_grid_api.html" target="_blank">http://matplotlib.org/mpl_toolkits/axes_grid/api/axes_grid_api.html</a><br>
# These choices of keyword arguments produce a four panel plot with a single<br>
# shared narrow colorbar on the right hand side of the multipanel plot. Axes<br>
# labels are drawn for all plots since we're slicing along different directions<br>
# for each plot.<br>
grid = AxesGrid(fig, (0.075,0.075,0.85,0.85),<br>
                nrows_ncols = (2, 1),<br>
                axes_pad = 0.05,<br>
                label_mode = "L",<br>
                share_all = True,<br>
                cbar_location="right",<br>
                cbar_mode="single",<br>
                cbar_size="3%",<br>
                cbar_pad="0%")<br>
<br>
for i, fn in enumerate(fns):<br>
    # Load the data and create a single plot<br>
    ds = yt.load(fn) # load data<br>
<br>
    # Make a ProjectionPlot with a width of 34 comoving megaparsecs<br>
    p = yt.ProjectionPlot(ds, 'z', 'density').annotate_grids()<br>
    #p = yt.SlicePlot(ds, 'z', 'density').annotate_grids()<br>
<br>
    # Ensure the colorbar limits match for all plots<br>
    #p.set_zlim('density', 1e-4, 1e-2)<br>
    p.set_zlim('density', minVal, maxVal)<br>
<br>
    # This forces the ProjectionPlot to redraw itself on the AxesGrid axes.<br>
    plot = p.plots['density']<br>
    plot.figure = fig<br>
    plot.axes = grid[i].axes<br>
    plot.cax = grid.cbar_axes[i]<br>
   <br>
    # Finally, this actually redraws the plot.<br>
    p._setup_plots()<br>
<br>
plt.savefig('multiplot_1x2_time_series.png', bbox_inches='tight')<br>
<br>
And it works fine EXCEPT that it doesn't annotate the grid structure..<br>
Any ideas somebody?<br>
<br>
Thank you very much,<br>
Best regards,<br>
Tim-Eric<br></div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Dominik Derigs<br>I. Physikalisches Institut<br>Universität zu Köln<br>Zülpicher Straße 77<br>50937 Köln<br>GERMANY<br><br>Tel. (+49|0) 221 470-8352<br>Fax. (+49|0) 221 470-5162<br><br>Diese Email ist vertraulich und nur für den angegebenen Empfänger bestimmt. Zugang, Freigabe, die Kopie, die Verteilung oder Weiterleitung durch jemand anderen außer dem Empfänger selbst ist verboten und kann eine kriminelle Handlung sein. Bitte löschen Sie die Email, wenn Sie sie durch einen Fehler erhalten haben und informieren Sie den Absender.<br><br>This email and any files transmitted with it may contain confidential and/or privileged material and is intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please notify the sender immediately and delete this material from all known records.</div></div></div></div></div></div>
</div></div>