擅长:python、mysql、java
<p>您需要将关键字<code>aspect='auto'</code>添加到<code>imshow</code>调用中。所以应该是这样的:</p>
<pre><code>fig.add_subplot(1, 2, 1).imshow(image, cmap=cm.Greys_r, aspect='auto')
</code></pre>
<p>根据文件:</p>
<blockquote>
<p>aspect : [‘auto’ | ‘equal’ | scalar], optional, default: None</p>
<p>If ‘auto’, changes the image aspect ratio to match that of the axes.</p>
<p>If ‘equal’, and extent is None, changes the axes aspect ratio to match that of the image. If extent is not None, the axes aspect ratio is changed to match that of the extent.</p>
<p>If None, default to rc image.aspect value.</p>
</blockquote>