Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import yt
- import matplotlib.pyplot as plt
- from mpl_toolkits.axes_grid1 import AxesGrid
- import sys
- fig = plt.figure()
- grid = AxesGrid(fig, (0.08, 0.075, 0.85, 0.28), nrows_ncols = (1, 3), axes_pad = 0.05, label_mode = "L", share_all = True, cbar_location = "right", cbar_mode = "single", cbar_size = "3%", cbar_pad = "0%")
- for i in range(1,len(sys.argv)):
- ds = yt.load(sys.argv[i])
- p = yt.SlicePlot(ds, 'z', "Temperature", width = (3.5, 'kpc'), fontsize = 12)
- p.set_zlim("Temperature", 1e1, 4e5)
- p.set_cmap(field="Temperature", cmap = "hot")
- p.annotate_title('z = %.2f'%ds.current_redshift)
- plot = p.plots["Temperature"]
- plot.figure = fig
- plot.axes = grid[i-1].axes
- plot.cax = grid.cbar_axes[i-1]
- p._setup_plots()
- plt.savefig("multiplot.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement