Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan8be committed Apr 16, 2024
1 parent 3bad508 commit 332bbff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions metadynminer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def plot_heights(self, png_name=None, energy_unit="kJ/mol", xlabel=None, ylabel=
ax.set_ylim(ylim)

if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')

def plot_CV(self, png_name=None, CV=None, xlabel=None, ylabel=None, label_size=12, image_size=None, image_size_unit="in", dpi=100, tu = "ps", time_min=None, time_max=None, points = True, point_size=1, xlim=[None, None], ylim=[None, None], title=None):
"""
Expand Down Expand Up @@ -649,7 +649,7 @@ def plot_CV(self, png_name=None, CV=None, xlabel=None, ylabel=None, label_size=1
ax.set_ylim(ylim)

if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')

class Fes:
"""
Expand Down Expand Up @@ -1415,7 +1415,7 @@ def plot(self, png_name=None, contours=True, contours_spacing=0.0, aspect = 1.0,
ax.set_ylim(ylim)

if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')

if self.cvs == 2:
fig = plt.figure(figsize=(image_size[0], image_size[1]), dpi=dpi)
Expand Down Expand Up @@ -1462,7 +1462,7 @@ def plot(self, png_name=None, contours=True, contours_spacing=0.0, aspect = 1.0,
ax.tick_params(axis='y', labelsize=label_size)

if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')

if self.cvs == 3:
if xlabel == None:
Expand Down Expand Up @@ -2954,7 +2954,7 @@ def plot(self, png_name=None, contours=True, contours_spacing=0.0, aspect = 1.0,
ax.set_ylim(ylim)

if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')


elif self.cvs == 2:
Expand Down Expand Up @@ -3023,7 +3023,7 @@ def plot(self, png_name=None, contours=True, contours_spacing=0.0, aspect = 1.0,
ax.tick_params(axis='y', labelsize=label_size)

if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')


elif self.cvs == 3:
Expand Down Expand Up @@ -3456,6 +3456,6 @@ def plot(self, png_name=None, image_size=None, image_size_unit="in", dpi=100, tu
ax.set_xlim(xlim)
ax.set_ylim(ylim)
if png_name != None:
plt.savefig(png_name)
plt.savefig(png_name, bbox_inches = 'tight')


12 changes: 7 additions & 5 deletions python_metadynminer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"id": "e34e2aae-ab72-491a-9113-dadd3ddac974",
"metadata": {},
"source": [
"Welcome to Metadynminer, our python package developed to make analysis of metadynamics simulations easy and user-friendly. This Jupyter notebook is designed to introduce metadynminer to new users and also to explain the algorithms used by metadynminer to some extent. "
"Welcome to Metadynminer, our python package developed to make analysis of metadynamics simulations easy and user-friendly. This Jupyter notebook is designed to introduce metadynminer to new users and also to explain the algorithms used by metadynminer to some extent. \n",
"\n",
"Just a reminder, if you are using this notebook in our online service to process your own results, don't forget to download all files you may have created to your PC for later use. "
]
},
{
Expand Down Expand Up @@ -355,7 +357,7 @@
"id": "e4ac1ef7-050d-49c4-964e-49fa84284331",
"metadata": {},
"source": [
"You can remove one CV from an existing FES (for example to make visualisation of 3D FES easier). For this purpose use the ```Fes.removeCV()``` method, which will return a new FES with one CV removed. The algorighm converts the FES to probabilities, then sums the probabilities along the given ```CV``` to be removed and then converts these sums back to free energy values. Because of this, you should provide the temperature of the simulation as well as the unit of free energy used in HILLS file. ```temp=300.0``` Kelvin and ```energy_unit=\"kJ/mol\"``` are the default values. "
"You can remove one CV from an existing FES (for example to make visualisation of 3D FES easier). For this purpose use the ```Fes.remove_CV()``` method, which will return a new FES with one CV removed. The algorighm converts the FES to probabilities, then sums the probabilities along the given ```CV``` to be removed and then converts these sums back to free energy values. Because of this, you should provide the temperature of the simulation as well as the unit of free energy used in HILLS file. ```temp=300.0``` Kelvin and ```energy_unit=\"kJ/mol\"``` are the default values. "
]
},
{
Expand Down Expand Up @@ -402,7 +404,7 @@
"id": "bd31b3e3-5c65-46a5-8411-1bbfa3644c47",
"metadata": {},
"source": [
"Another way to visualise 2D FES is by creating a surface plot. This method only works for 2D FESs. This works best together with ```%matplotlib widget``` turned on (you can find the line at the beginning of this notebook). If you find the animation too slow, it may be necessary to decrease the resolution of the FES. "
"Another alternative way to visualise 2D FES is by creating a surface plot. This method only works for 2D FESs. This works best together with ```%matplotlib widget``` turned on (you can find the line at the beginning of this notebook). If you find the animation too slow, it may be necessary to decrease the resolution of the FES. "
]
},
{
Expand Down Expand Up @@ -439,7 +441,7 @@
"id": "cbbaf80a-a52a-4ff2-8e4e-ecf4985f5ca0",
"metadata": {},
"source": [
"The resulting animation (if available):\n",
"The resulting animation (if available). Maybe you will need to refresh this page of your browser for the animation to be shown:\n",
"\n",
"<img src=\"fes_animation.gif\" width=\"750\" align=\"center\"/>"
]
Expand Down Expand Up @@ -468,7 +470,7 @@
"id": "f1c0752e-86ca-41c2-9caa-21c7bbf80fbd",
"metadata": {},
"source": [
"The resulting animation: \n",
"Again, maybe you will need to refresh this page of your browser for the resulting animation to be shown:\n",
"\n",
"<img src=\"flooding.gif\" width=\"750\" align=\"center\"/>"
]
Expand Down

0 comments on commit 332bbff

Please sign in to comment.