title: How to rotate a Subplot by 45 degree in Matplotlib?
body: <p>I am trying to explore a subplot 2 plots with square in shape rotated by 45 degree. </p>
  
  <pre><code>import matplotlib.pyplot as plt
  from matplotlib import colors
  import numpy as np
  
  data = np.random.rand(10, 10) * 20
  
  # create discrete colormap
  cmap = colors.ListedColormap(['red', 'blue','green'])
  bounds = [0,5,10,15]
  norm = colors.BoundaryNorm(bounds, cmap.N)
  
  fig, ax= plt.subplots(1,2)
  
  ax[0].imshow(data, cmap=cmap, norm=norm)
  
  # draw gridlines
  ax[0].grid(which='major', axis='both', linestyle='-', color='k', linewidth=0)
  ax[0].set_xticks(np.arange(-.5, 10, 1));
  ax[0].set_yticks(np.arange(-.5, 10, 1));
  
  
  ax[1].imshow(data, cmap=cmap, norm=norm)
  
  # draw gridlines
  ax[1].grid(which='major', axis='both', linestyle='-', color='k', linewidth=0)
  ax[1].set_xticks(np.arange(-.5, 10, 1));
  ax[1].set_yticks(np.arange(-.5, 10, 1));
  
  plt.show()
  </code></pre>
  
  <p>Actual Result is :-</p>
  
  <p><a href="https://i.stack.imgur.com/evqNG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/evqNG.jpg" alt="enter image description here"></a></p>
  
  <p><strong>I want to rotate individual plot by 45 degree. Something like:-</strong> 
  <a href="https://i.stack.imgur.com/VUvMa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VUvMa.png" alt="enter image description here"></a></p>
  
  <p>I am trying to find in Matplotlib Documentation. Still not getting. Any help?</p>
  
  <p>Please note this is NOT DUPLICATE OF </p>
  
  <p><a href="https://stackoverflow.com/questions/12848581/is-there-a-way-to-rotate-a-matplotlib-plot-by-45-degrees">Is there a way to rotate a matplotlib plot by 45 degrees?</a></p>
  
  <p>The mentioned URL is for a plot. and the solution is to rotate IMAGE. However this is pertaining to Subplot. I want to rotate PLOT not image as whole.</p>