您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

11 行
334B

  1. def force_aspect(ax, aspect=1):
  2. im = ax.get_images()
  3. extent = im[0].get_extent()
  4. ax.set_aspect(abs((extent[1]-extent[0])/(extent[3]-extent[2]))/aspect)
  5. def mpl_matshow(ax, data, shape):
  6. ax.matshow(data.reshape(shape, shape), cmap='hot', aspect='auto')
  7. ax.set_xticks([])
  8. ax.set_yticks([])
  9. force_aspect(ax)