0

I am using colab notebook for generating some numbers using autoencoders. I am able to generate the numbers successfully but it is really small and invisible. I am using matplotlib for data viz.

Here is my plot_image function:

  def plot_image(image, shape=[28,28]):
     plt.imshow(image.reshape(shape), cmap="Greys", interpolation="nearest")
     plt.axis("off")

Here is my code for visualizing the numbers:

  for iteration in range(n_digits):
     plt.subplot(n_digits, 10, iteration+1)
     plot_image(outputs_val[iteration])

I am also using matplotlib inline function as:

%matplotlib inline

Can anyone guide me to visualize my result with a bigger plot? I am attaching the screenshot of my generated result.Thanks in advance guys.

Here is the result of my numbers

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Sonu
  • 59
  • 2
  • 13
  • Sometimes my plots are small when I call `plt.show()` but then I can resize the window and it grows with it. Would that be applicable with %matplotlib inline? Or maybe instead of a 10 X 1 you could make a 5 X 2 or 3 X 3 and omit the last graph? Here is their documentation: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplot.html?highlight=subplot#matplotlib.pyplot.subplot It tells you all the methods available to you, as well as some examples at the bottom you can look through! – Reedinationer Feb 26 '19 at 18:30
  • i tried as you said but still its same. Let me go through the link that u mentioned. Thanks though – Sonu Feb 26 '19 at 18:35
  • possible duplicate of - https://stackoverflow.com/questions/36367986/how-to-make-inline-plots-in-jupyter-notebook-larger – R4444 Feb 26 '19 at 18:35

1 Answers1

0

You can increase the figure size by use the figure command. See below

def plot_image(image, shape=[28,28]):
    fig = plt.figure(figsize=(18, 18)) # set the height and width in inches
    plt.imshow(image.reshape(shape), cmap="Greys", interpolation="nearest")
    plt.axis("off")
    plt.show()
plasmon360
  • 4,109
  • 1
  • 16
  • 19
  • Thanks this works but can you explain little about height*width in inches? what are the ideal combo to use? – Sonu Feb 26 '19 at 18:44