25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
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)