Skip to content
Snippets Groups Projects
Commit 11f162d0 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Minor polishing of corner plots

parent 78ecb25b
No related branches found
No related tags found
No related merge requests found
import numpy as np
import matplotlib.pyplot as plt
import pyfstat
import gridcorner
from make_simulated_data import tstart, duration, tref, F0, F1, F2, Alpha, Delta, delta_F0, dtglitch, outdir
plt.style.use('paper')
plt.style.use('./paper.mplstyle')
label = 'semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch'
......@@ -47,5 +48,7 @@ mcmc.transform_dictionary['F1'] = dict(
subtractor=F1, symbol='$\dot{f}-\dot{f}^\mathrm{s}$')
mcmc.run()
mcmc.plot_corner(label_offset=0.15, truths=[0, 0, delta_F0, 50])
fig_and_axes = gridcorner._get_fig_and_axes(4, 2, 0.05)
mcmc.plot_corner(label_offset=0.35, truths=[0, 0, delta_F0, 50],
fig_and_axes=fig_and_axes)
mcmc.print_summary()
......@@ -12,7 +12,7 @@ except ImportError:
label = 'semicoherent_glitch_robust_directed_grid_search_on_1_glitch'
plt.style.use('paper')
plt.style.use('./paper.mplstyle')
Nstar = 1000
F0_width = np.sqrt(Nstar)*np.sqrt(12)/(np.pi*duration)
......@@ -29,6 +29,8 @@ tglitchs = [tstart+0.1*duration, tstart+0.9*duration, 0.8*float(duration)/N]
delta_F0s = [0, max_delta_F0, max_delta_F0/N]
delta_F1s = [0]
print 'Prior widths=', F0_width, F1_width
search = pyfstat.GridGlitchSearch(
label, outdir, 'data/*1_glitch*sft', F0s=F0s, F1s=F1s, F2s=F2s,
Alphas=Alphas, Deltas=Deltas, tref=tref, minStartTime=tstart,
......@@ -48,7 +50,7 @@ xyz = [F0_vals, F1_vals, delta_F0s_vals, tglitch_vals_days]
labels = ['$f - f^\mathrm{s}$\n[Hz]', '$\dot{f} - \dot{f}^\mathrm{s}$\n[Hz/s]',
'$\delta f$\n[Hz]', '$t^g_0$\n[days]', '$\widehat{2\mathcal{F}}$']
fig, axes = gridcorner(
twoF, xyz, projection='log_mean', whspace=0.1, factor=1.2, labels=labels,
showDvals=False, lines=[0, 0, delta_F0, 50])
twoF, xyz, projection='log_mean', labels=labels,
showDvals=False, lines=[0, 0, delta_F0, 50], label_offset=0.35)
fig.savefig('{}/{}_projection_matrix.png'.format(outdir, label),
bbox_inches='tight')
......@@ -743,7 +743,7 @@ class MCMCSearch(core.BaseSearchClass):
max_n_ticks=4,
plot_contours=True,
plot_datapoints=True,
label_kwargs={'fontsize': 12},
#label_kwargs={'fontsize': 12},
data_kwargs={'alpha': 0.1,
'ms': 0.5},
range=_range,
......@@ -762,10 +762,10 @@ class MCMCSearch(core.BaseSearchClass):
ax.set_rasterization_zorder(-10)
for tick in ax.xaxis.get_major_ticks():
tick.label.set_fontsize(8)
#tick.label.set_fontsize(8)
tick.label.set_rotation('horizontal')
for tick in ax.yaxis.get_major_ticks():
tick.label.set_fontsize(8)
#tick.label.set_fontsize(8)
tick.label.set_rotation('vertical')
plt.tight_layout(h_pad=0.0, w_pad=0.0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment