Closed jeiros closed 7 years ago
Hi,
I'm running into a weird issue with plot_free_energy and I can't think of why it's happening.
plot_free_energy
I load some trajectories using a dataset from msmbuilder, featurize and scale them. The tICA time series look normal:
dataset
pipeline = Pipeline([ ('feat', AtomPairsFeaturizer(atom_pairs)), ('scale', RobustScaler()), ('tica', tICA(n_components=3, lag_time=100)), ('cluster', MiniBatchKMeans(n_clusters=500)), ('msm', MarkovStateModel(lag_time=100, n_timescales=5)) ]) scaled_data = pipeline.named_steps['scale'].fit_transform(pipeline.named_steps['feat'].fit_transform(xyz)) tica_trajs = pipeline.named_steps['tica'].fit_transform(scaled_data) ax, side_ax = msme.plot_trace(np.concatenate(tica_trajs)[:, 0], label='tIC1', xlabel='Timestep', color='rawdenim') _ = msme.plot_trace(np.concatenate(tica_trajs)[:, 1], label='tIC2', xlabel='Timestep', color='cochineal', ax=ax, side_ax=side_ax)
But the free energy plot colors the most dense region with the same colour as where there are no data points:
msme.plot_free_energy(np.concatenate(tica_trajs), obs=(0, 1), pi=None, shade=True, n_levels=5, cmap='Spectral', clabel=True, clabel_kwargs={'fmt': '%.1f'}, xlabel='tIC1', ylabel='tIC2' )
I've tried using other color maps and changin the n_levels argument, but I still get the white region in the center. Have you seen this before / have any idea of why this might be happening?
n_levels
Try vmin=-1e-12 or a very small (in absolute value) negative number. Maybe this should be set as the default.
vmin=-1e-12
Thanks, that did the trick!
Hi,
I'm running into a weird issue with
plot_free_energy
and I can't think of why it's happening.I load some trajectories using a
dataset
from msmbuilder, featurize and scale them. The tICA time series look normal:But the free energy plot colors the most dense region with the same colour as where there are no data points:
I've tried using other color maps and changin the
n_levels
argument, but I still get the white region in the center. Have you seen this before / have any idea of why this might be happening?