MDAnalysis / membrane-curvature

MDAnalysis tool to calculate membrane curvature.
https://membrane-curvature.readthedocs.io/
GNU General Public License v3.0
29 stars 6 forks source link

Examples in documentation show incorrect plots. #88

Closed ojeda-e closed 1 year ago

ojeda-e commented 2 years ago

Context: The figures included in docs use either contourf or imshow. In both cases, the resulting surface/curvature array is plotted as (M, N) array-like.

From the plt.contourf docs:

Parameters
-----------

X, Y array-like, optional: 
    The coordinates of the values in Z.

    X and Y must both be 2D with the same shape as Z (e.g. created via numpy.meshgrid), 
    or they must both be 1-D such that len(X) == N is the number of columns in Z and 
    len(Y) == M is the number of rows in Z.

    If not given, they are assumed to be integer indices, i.e. X = range(N), Y = range(M).

Similar story with plt.imshow. Hence, the resulting surface/curvature array should be transposed to generate the correct plot.

To illustrate the issue, here below is an example using plt.imshow from the Membrane Curvature Visualization page

Current plot: 😞

drawing

Expected plot: ☺️

drawing

To fix this issue, update all the figures in the visualization and tutorial pages.

ojeda-e commented 2 years ago

While fixing this, also fix docstrings in mean curvature function:

https://github.com/MDAnalysis/membrane-curvature/blob/ab0d65257d5d89165dcf3987a6e90325aea6dadd/membrane_curvature/curvature.py#L92

should be mean curvature, not gaussian. Also is Gaussian instead of "gaussian".