diff --git a/metadynminer/__init__.py b/metadynminer/__init__.py index 153aa65..4e3ead8 100644 --- a/metadynminer/__init__.py +++ b/metadynminer/__init__.py @@ -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): """ @@ -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: """ @@ -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) @@ -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: @@ -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: @@ -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: @@ -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') diff --git a/python_metadynminer.ipynb b/python_metadynminer.ipynb index 9ae800a..45e3811 100644 --- a/python_metadynminer.ipynb +++ b/python_metadynminer.ipynb @@ -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. " ] }, { @@ -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. " ] }, { @@ -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. " ] }, { @@ -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", "" ] @@ -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", "" ]