Skip to content

Commit

Permalink
Use rasterized plots (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-czyz authored Jan 26, 2024
1 parent d4eb1d8 commit 4cfc2ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workflows/Mixtures/fitting_gmm.smk
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ rule plot_pdf:
mi_approx = np.mean(pmi_approx, axis=1) # (num_mcmc_samples,)
ax.set_xlabel("MI")

ax.hist(mi_approx, bins=50, density=True, alpha=0.5, color="red")
ax.hist(mi_approx, bins=50, density=True, alpha=0.5, color="red", rasterized=True)
ax.axvline(mi_approx.mean(), color="red") # Visualise posterior mean
ax.axvline(mi_true, color="k", linestyle=":") # Visualise true value

Expand All @@ -234,10 +234,10 @@ rule plot_pdf:
bins = np.linspace(min_val, max_val, 50)
for pmi_vals in pmi_approx:
prof, _ = np.histogram(pmi_vals, bins=bins, density=True)
ax.stairs(prof, edges=bins, color="red", alpha=0.05)
ax.stairs(prof, edges=bins, color="red", alpha=0.05, rasterized=True)

prof_true, _ = np.histogram(pmi_true, bins=bins, density=True)
ax.stairs(prof_true, edges=bins, color="k", alpha=1)
ax.stairs(prof_true, edges=bins, color="k", alpha=1, rasterized=True)

for ax in [axs[2], axs[3]]:
ax.set_ylabel("")
Expand Down

0 comments on commit 4cfc2ca

Please sign in to comment.