Skip to content
Snippets Groups Projects
Commit de325e0e authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 5bc52346
No related branches found
No related tags found
No related merge requests found
......@@ -157,11 +157,11 @@ def plot_roc_curve(correct_labels, prob_pos_class):
plt.savefig('/home/rink/test_roc', dpi=320)
def plot_image(image, fname, label, cmap='Greys'):
def plot_image(image, fname=None, cmap='Greys', vmin=-1.5, vmax=2.5):
Fig, ax = plt.subplots()
# Plot the image
plt.imshow(image, interpolation="nearest", cmap=cmap, vmin=-1.5,vmax=2.5)
plt.imshow(image, interpolation="nearest", cmap=cmap, vmin=vmin, vmax=vmax)
# plt.imshow(image, interpolation="nearest", cmap=cmap, vmin=-0.5,vmax=1.5)
# plt.imshow(radGrid, interpolation = "nearest", cmap = cmap, vmin = vmin, vmax = vmax)
# plt.title(os.path.basename(InFileWV), fontsize=10)
......@@ -178,11 +178,13 @@ def plot_image(image, fname, label, cmap='Greys'):
# Finish the figure settings and save to a file
Fig.set_size_inches([10.0, 6.6], forward=True)
Fig.set_dpi(100) # This seems to not get applied. Always 100?
# Fig.show() # Display
# Save to file
ImageDirAndName = os.path.join('/Users/tomrink', fname)
Fig.savefig(ImageDirAndName)
if fname is not None:
ImageDirAndName = os.path.join('/Users/tomrink', fname)
Fig.savefig(ImageDirAndName)
else:
Fig.show()
# Wrap up
Fig.clf() # Otherwise fig stays open every time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment