Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(15,5))
  2. my_cmap = copy.copy(mpl.cm.get_cmap('inferno'))
  3. my_cmap.set_bad((0,0,0))
  4.  
  5. ax[0].set_xlabel('$x_c$ [$mathrm{kpc}$]')
  6. ax[0].set_ylabel('$y_c$ [$mathrm{kpc}$]')
  7. ax[0].set_aspect('equal')
  8. ax[0].hist2d(x_plot, y_plot, bins=(bin_num, bin_num), norm=mpl.colors.LogNorm(), cmap=my_cmap, range=[[-box_size, box_size], [-box_size, box_size]])
  9.  
  10. ax[1].set_xlabel('$y_c$ [$mathrm{kpc}$]')
  11. ax[1].set_ylabel('$z_c$ [$mathrm{kpc}$]')
  12. ax[1].set_aspect('equal')
  13. ax[1].hist2d(y_plot, z_plot, bins=(bin_num, bin_num), norm=mpl.colors.LogNorm(), cmap=my_cmap, range=[[-box_size, box_size], [-box_size, box_size]])
  14.  
  15. ax[2].set_xlabel('$x_c$ [$mathrm{kpc}$]')
  16. ax[2].set_ylabel('$z_c$ [$mathrm{kpc}$]')
  17. ax[2].set_aspect('equal')
  18. ax[2].hist2d(x_plot, z_plot, bins=(bin_num, bin_num), norm=mpl.colors.LogNorm(), cmap=my_cmap, range=[[-box_size, box_size], [-box_size, box_size]])
  19.  
  20. fig.suptitle('Dark matter density', y=0.99)
  21. plt.tight_layout()
  22. plt.savefig('dm_density.pdf', dpi=300)
  23. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement