Plot google map as background
<p>I want to display Google map and I use this code :</p>

<pre><code>url = "http://maps.googleapis.com/maps/api/staticmap?center=-30.027489,-51.229248&amp;size=800x800&amp;zoom=14&amp;sensor=false"
im = Image.open(cStringIO.StringIO(urllib2.urlopen(url).read()))
plt.imshow(im)
plt.show()
</code></pre>

<p>this gives me:<a href="http://i.stack.imgur.com/zjshO.png" rel="nofollow"><img src="http://i.stack.imgur.com/zjshO.png" alt="enter image description here"></a></p>

<p>Which I don't understand</p>

<p>Take a look at the <a href="http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.imshow" rel="nofollow">documentation of <code>imshow()</code></a> and specifically its <code>origin</code> argument which determines where the [0,0] index of the array is located in the plot.</p>

<p>The line needs to be:</p>

<pre><code>plt.imshow(im, origin='upper')
</code></pre>

python image google-maps url