title: Plot pixel values that I already extracted from an image and stored into a txt file
body: <p>I am new to <strong>Python</strong> (I use <strong>2.7</strong> version) and I am trying to do some tests of a camera, and in order to do so I have to analsye the pixels of an image.</p>
  
  <p>Here is the image: <a href="https://i.stack.imgur.com/wbbZ1.jpg" rel="nofollow noreferrer">Image of ColorChecker I want to analyse</a> (I have four other images in <strong>.tif</strong> format but it's not a problem I guess ?).</p>
  
  <p>I have already wrote a code that takes the pixels and store them into a txt file.</p>
  
  <p>Now, I don't know how to pute this data and <strong>2D plot</strong> it in order to vizualise the pixels (there is more than 1 million value in the stored list).</p>
  
  <blockquote>
    <p>size(all_pixels)
    Out[10]: 1228800</p>
  </blockquote>
  
  <p>Any help please ? </p>
  
  <p>Here is the image:</p>
  
  <pre><code>    from PIL import Image
  import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.cm as cm
  
   # Get the image
  im = Image.open("C:/Users/admin/Desktop/IM.tif")
  
  pixels = im.load() # this is not a list, nor is it list()'able
  width, height = im.size
  
  # Get the pixels
  all_pixels = []
  for x in range(width):
      for y in range(height):
          cpixel = pixels[x, y]
          all_pixels.append(cpixel)
  
  # Store the pixels into a txt file
  thefile = open('C:/Users/admin/Desktop/testo.txt', 'w')
  for item in all_pixels:
    thefile.write("%s\n" % item)
  </code></pre>