title: Trying to resize an image that is printed out by matplotlib.pyplot
body: <p>I am trying to use openCV in order to attain a black and white image of a picture, coloring in highly gradient pixels in white, and low gradient with black. I am currently using anaconda spyder and have been able to create the new image, but the image resolution is significantly lower than the image that I have supplied. Does anyone know how to resize an image produced by plt.imshow?</p>
  
  <p>My code is as follows, and I have attached a picture.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib.image as mpimg
  import numpy as np
  import cv2
  
  image = mpimg.imread('exit-ramp.jpg')
  plt.imshow(image)
  gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY) #grayscale conversion
  plt.imshow(gray, cmap='gray')
  
  kernel_size = 3
  blur_gray = cv2.GaussianBlur(gray, (kernel_size, kernel_size), 0)
  lowthresh = 125
  highthresh = 150
  edges = cv2.Canny(blur_gray, lowthresh, highthresh)
  
  plt.imshow(edges, cmap = 'Greys_r', aspect = 'auto')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GlB1T.png" rel="nofollow noreferrer">output of my code</a></p>
  
  <p><a href="https://i.stack.imgur.com/rJYKr.jpg" rel="nofollow noreferrer">picture to take gradient of</a></p>