Use v{min,max} for enforcing matplotlib colormap

If it proceeds linearly to *covers the complete value range of the supplied data* then doing so is unnecessary and even if it is another not very different scale transformation then it is still fine for my goal.
This commit is contained in:
2024-03-29 12:11:41 +01:00
parent 5fa61f7ff8
commit b375acbb3a
2 changed files with 11 additions and 3 deletions

View File

@@ -5,10 +5,11 @@ from matplotlib import pyplot as plt
def randomGaussianImage(scale, size):
return np.random.normal(loc = 0, scale = scale, size = size)
def showImageWithMatplotlib(npArray, title = None):
# `cmap` source: https://matplotlib.org/3.8.0/api/_as_gen/matplotlib.pyplot.imshow.html
def showImageWithMatplotlib(npArray, title = None, cmap = 'viridis'):
if title is not None:
plt.title(title)
plt.imshow(npArray)
plt.imshow(npArray, cmap = cmap)
plt.show()
def toPilImage(npArray):