skoch9 / meshplot

Plot 3D triangle meshes
GNU General Public License v3.0
148 stars 37 forks source link

Normalisation doesn't seem to work #17

Open bertinets opened 4 years ago

bertinets commented 4 years ago

Seems to me that the 'normalize' option for the shading doesn't work. After having a look at the helper functions in utils.py (lines 5-10) the problems seems to be here:

def get_colors(inp, colormap="viridis", normalize=True, vmin=None, vmax=None): colormap = plt.cm.get_cmap(colormap) if normalize: vmin=np.min(inp) vmax=np.max(inp)

I think that should be change in:

def get_colors(inp, colormap="viridis", normalize=True, vmin=None, vmax=None): colormap = plt.cm.get_cmap(colormap) if not normalize: vmin=np.min(inp) vmax=np.max(inp)