Skip to content

Commit 332bbff

Browse files
committed
bug fix
1 parent 3bad508 commit 332bbff

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

metadynminer/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def plot_heights(self, png_name=None, energy_unit="kJ/mol", xlabel=None, ylabel=
500500
ax.set_ylim(ylim)
501501

502502
if png_name != None:
503-
plt.savefig(png_name)
503+
plt.savefig(png_name, bbox_inches = 'tight')
504504

505505
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):
506506
"""
@@ -649,7 +649,7 @@ def plot_CV(self, png_name=None, CV=None, xlabel=None, ylabel=None, label_size=1
649649
ax.set_ylim(ylim)
650650

651651
if png_name != None:
652-
plt.savefig(png_name)
652+
plt.savefig(png_name, bbox_inches = 'tight')
653653

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

14171417
if png_name != None:
1418-
plt.savefig(png_name)
1418+
plt.savefig(png_name, bbox_inches = 'tight')
14191419

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

14641464
if png_name != None:
1465-
plt.savefig(png_name)
1465+
plt.savefig(png_name, bbox_inches = 'tight')
14661466

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

29562956
if png_name != None:
2957-
plt.savefig(png_name)
2957+
plt.savefig(png_name, bbox_inches = 'tight')
29582958

29592959

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

30253025
if png_name != None:
3026-
plt.savefig(png_name)
3026+
plt.savefig(png_name, bbox_inches = 'tight')
30273027

30283028

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

34613461

python_metadynminer.ipynb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"id": "e34e2aae-ab72-491a-9113-dadd3ddac974",
1414
"metadata": {},
1515
"source": [
16-
"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. "
16+
"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",
17+
"\n",
18+
"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. "
1719
]
1820
},
1921
{
@@ -355,7 +357,7 @@
355357
"id": "e4ac1ef7-050d-49c4-964e-49fa84284331",
356358
"metadata": {},
357359
"source": [
358-
"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. "
360+
"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. "
359361
]
360362
},
361363
{
@@ -402,7 +404,7 @@
402404
"id": "bd31b3e3-5c65-46a5-8411-1bbfa3644c47",
403405
"metadata": {},
404406
"source": [
405-
"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. "
407+
"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. "
406408
]
407409
},
408410
{
@@ -439,7 +441,7 @@
439441
"id": "cbbaf80a-a52a-4ff2-8e4e-ecf4985f5ca0",
440442
"metadata": {},
441443
"source": [
442-
"The resulting animation (if available):\n",
444+
"The resulting animation (if available). Maybe you will need to refresh this page of your browser for the animation to be shown:\n",
443445
"\n",
444446
"<img src=\"fes_animation.gif\" width=\"750\" align=\"center\"/>"
445447
]
@@ -468,7 +470,7 @@
468470
"id": "f1c0752e-86ca-41c2-9caa-21c7bbf80fbd",
469471
"metadata": {},
470472
"source": [
471-
"The resulting animation: \n",
473+
"Again, maybe you will need to refresh this page of your browser for the resulting animation to be shown:\n",
472474
"\n",
473475
"<img src=\"flooding.gif\" width=\"750\" align=\"center\"/>"
474476
]

0 commit comments

Comments
 (0)