Skip to content

plot_density function seems to be switching x and y axes? #302

Open
@ramansbach

Description

@ramansbach

When using plot_density on a 2D PCA projection of the well-known pentapeptide system, it looks to me as if variables are being plotted in reverse order in the density function (that is, $x$ and $y$ being swapped?) Unless I'm misunderstanding what it's supposed to be doing--it doesn't match the the output of plot_energy2d. I've attached my conda list so you can see the environment I'm working in (msmcondalist.txt).

Compare (pc2,pc1 in a different order in the two functions, result in plots that look the same):

fig,axes = plt.subplots(1,2,figsize=(8,3))
deeptime.plots.plot_density(pc1,pc2, ax=axes[0])
energies = deeptime.util.energy2d(pc2,pc1)
deeptime.plots.plot_energy2d(energies,ax=axes[1])
for ax in axes.flat[1:]:
ax.set_xlabel('PC 1')
ax.set_ylabel('PC 2')
fig.tight_layout()

which results in

image

versus (pc1,pc2 given in the same order in both functions)

fig,axes = plt.subplots(1,2,figsize=(8,3))
deeptime.plots.plot_density(pc1,pc2, ax=axes[0])
energies = deeptime.util.energy2d(pc1,pc2)
deeptime.plots.plot_energy2d(energies,ax=axes[1])
for ax in axes.flat[1:]:
ax.set_xlabel('PC 1')
ax.set_ylabel('PC 2')
fig.tight_layout()

which results in

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions