Created
November 7, 2021 09:54
-
-
Save MarcoGorelli/2bfe9031a8ca2d92b8942915fbdba37a to your computer and use it in GitHub Desktop.
density changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig, axes = plt.subplots(nrows=1, ncols=2, sharex=False, sharey=False) | |
axes = axes.flatten() | |
data = pd.DataFrame(samples, columns=["x_0", "x_1"]) | |
sns.kdeplot(data=data, x="x_0", y="x_1", ax=axes[0]) | |
data = pd.DataFrame(pushforward_samples, columns=["x_tilde_0", "x_tilde_1"]) | |
sns.kdeplot(data=data, x="x_tilde_0", y="x_tilde_1", ax=axes[1]) | |
xyA = [2.5, -0.6] | |
xyB = [-0.1, .87] | |
arrow = patches.ConnectionPatch( | |
xyA, | |
xyB, | |
coordsA=axes[0].transData, | |
coordsB=axes[1].transData, | |
color="black", | |
arrowstyle="-|>", | |
) | |
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=1, hspace=None) | |
axes[0].set_title(r"Density of $\mathbf{X}$") | |
axes[1].set_title(r"Density of $g(\mathbf{X})$") | |
fig.patches.append(arrow) | |
fig.savefig("transformation.png"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment