SHARE
TWEET

Untitled

a guest Dec 16th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. img_orig   = plt.imread('Untitled 25.png')
  5.  
  6. # r, g, b, a = np.moveaxis(imgorig, 2, 0)
  7. three      = np.moveaxis(img_orig, 2, 0)[:3]
  8. three_flat = [x.flatten() for x in three]
  9. names      = ('r', 'g', 'b')
  10.  
  11. if True:
  12.     plt.figure()
  13.     for i, (img, name) in enumerate(zip(three, names)):
  14.         plt.subplot(2, 3, i+1+0)
  15.         plt.imshow(img, vmin=0, vmax=1, cmap='gray')
  16.         plt.title(name, fontsize=16)
  17.     for i in range(3):
  18.         plt.subplot(2, 3, i+1+3)
  19.         plt.plot(three_flat[(i+0)%3], three_flat[(i+1)%3], '.k')
  20.         plt.title(names[(i+1)%3] + ' vs ' + names[(i+0)%3], fontsize=16)
  21.     plt.show()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top