zoukankan      html  css  js  c++  java
  • matplotlib.pyplot如何绘制多张子图

    1,25张图片

    plt.figure(figsize=(10,10))

    for i in range(25):
      plt.subplot(5,5,i+1)
      //plt.subplot(a,b,i+1) a*b>=25
      plt.xticks([])
      plt.yticks([])
      plt.grid(False)
      plt.imshow(train_images[i], cmap=plt.cm.binary)
      plt.xlabel(class_names[train_labels[i]])
    plt.show()

    2,两张图片

    i = 0
    plt.figure(figsize=(6,3))
    plt.subplot(1,2,1)
    plot_image(i, predictions, test_labels, test_images)
    plt.subplot(1,2,2)
    plot_value_array(i, predictions, test_labels)
    plt.show()

  • 相关阅读:
    作业三3
    作业三2(改过)
    第一章
    实验2
    第三章
    例2-11
    例2-10
    例2-8
    例2-9
    例2-7
  • 原文地址:https://www.cnblogs.com/augustone/p/10505533.html
Copyright © 2011-2022 走看看