Skip to content

Commit

Permalink
Move legend location
Browse files Browse the repository at this point in the history
  • Loading branch information
e-koch committed Feb 8, 2019
1 parent 9bccc17 commit 5ece71d
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions analysis/line_ratios_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@

plt.tight_layout()

# plt.savefig(osjoin(fig_path, "coldens_fit_vs_fwhm_check.png"))
# plt.savefig(osjoin(fig_path, "coldens_fit_vs_fwhm_check.pdf"))
plt.savefig(osjoin(fig_path, "coldens_fit_vs_fwhm_check.png"))
plt.savefig(osjoin(fig_path, "coldens_fit_vs_fwhm_check.pdf"))
plt.close()


Expand Down Expand Up @@ -263,8 +263,6 @@ def _logprob(p, x, y, x_err, y_err):

plt.tight_layout()

print(argh)

plt.savefig(osjoin(fig_path, "sigma_HI_vs_H2_w_fit.png"))
plt.savefig(osjoin(fig_path, "sigma_HI_vs_H2_w_fit.pdf"))
plt.close()
Expand Down Expand Up @@ -294,22 +292,29 @@ def _logprob(p, x, y, x_err, y_err):

axs = fig.get_axes()

axs[2].plot([4, 12], [4. * slope_ratio, 12. * slope_ratio],
'--', color=sb.color_palette()[2], linewidth=3,
label='Ratio Fit')
line1 = axs[2].plot([4, 12], [4. * slope_ratio, 12. * slope_ratio],
'--', color=sb.color_palette()[2], linewidth=3,
label='Ratio Fit')


axs[2].plot([4, 12], [4, 12], '-.', linewidth=3, alpha=0.8,
color=sb.color_palette()[3],
label=r'$\sigma_{\rm CO} = \sigma_{\rm HI}$')
line2 = axs[2].plot([4, 12], [4, 12], '-.', linewidth=3, alpha=0.8,
color=sb.color_palette()[3],
label=r'$\sigma_{\rm CO} = \sigma_{\rm HI}$')

axs[2].axhline(2.6, color=sb.color_palette()[4], linestyle=':',
alpha=0.8, linewidth=3)

axs[2].set_ylim([0.5, 8])
axs[2].legend(frameon=True, loc='lower right')
axs[2].set_ylim([2.0, 8])
# axs[2].legend(frameon=True, loc='lower right')
axs[2].grid()

handles, labels = axs[2].get_legend_handles_labels()
fig.legend(handles,
(r'Ratio Fit: $\sigma_{\rm CO} = 0.56\, \sigma_{\rm HI}$',
r'$\sigma_{\rm CO} = \sigma_{\rm HI}$'),
frameon=True, loc=(0.56, 0.6),)


# plt.tight_layout()
plt.subplots_adjust(hspace=0.03, wspace=0.03)

Expand Down

0 comments on commit 5ece71d

Please sign in to comment.