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

snapshot...

parent 6f6ac7e6
No related branches found
No related tags found
No related merge requests found
...@@ -157,23 +157,23 @@ def plot_roc_curve(correct_labels, prob_pos_class): ...@@ -157,23 +157,23 @@ def plot_roc_curve(correct_labels, prob_pos_class):
plt.savefig(homedir+'test_roc', dpi=320) plt.savefig(homedir+'test_roc', dpi=320)
def plot_image(image, fname=None, cmap='Greys', vmin=None, vmax=None): def plot_image(image, cmap='Greys', vmin=None, vmax=None, fname=None, title=None, do_color_bar=True):
Fig, ax = plt.subplots() Fig, ax = plt.subplots()
# Plot the image # Plot the image
plt.imshow(image, interpolation="nearest", cmap=cmap, vmin=vmin, vmax=vmax) plt.imshow(image, interpolation="nearest", cmap=cmap, vmin=vmin, vmax=vmax)
# plt.imshow(image, interpolation="nearest", cmap=cmap, vmin=-0.5,vmax=1.5) if title is not None:
# plt.imshow(radGrid, interpolation = "nearest", cmap = cmap, vmin = vmin, vmax = vmax) plt.title(os.path.basename(title), fontsize=10, fontweight='bold')
# plt.title(os.path.basename(InFileWV), fontsize=10)
# Add the colorbar # Add the colorbar
cbar = plt.colorbar(ticks=range(3)) if do_color_bar:
cbar.ax.set_position([0.90, 0.05, 0.03, 0.90]) # [left, bottom, width, height] cbar = plt.colorbar(ticks=range(3))
#cbar.ax.set_ylabel(label, rotation=90, fontsize=10) cbar.ax.set_position([0.90, 0.05, 0.03, 0.90]) # [left, bottom, width, height]
#cbar.ax.tick_params(labelsize=10) #cbar.ax.set_ylabel(label, rotation=90, fontsize=10)
#cbar.ax.tick_params(labelsize=10)
# *Now* that the colorbar is out, we can set the plot's axis position
ax.set_position([0.05, 0.05, 0.83, 0.90]) # [left, bottom, width, height] # *Now* that the colorbar is out, we can set the plot's axis position
ax.set_position([0.05, 0.05, 0.83, 0.90]) # [left, bottom, width, height]
# Finish the figure settings and save to a file # Finish the figure settings and save to a file
Fig.set_size_inches([10.0, 6.6], forward=True) Fig.set_size_inches([10.0, 6.6], forward=True)
......
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