It would be easier if there were some code to reproduce the problem - it wouldn’t have to be the actual data you are using.
I wasn’t able to reproduce the problem with the following code:
import mpl_toolkits.basemap as bm
import matplotlib.pyplot as plt
Geotiff from http://earthobservatory.nasa.gov/IOTD/view.php?id=49687
FROM gdalinfo
#Corner Coordinates:
#Upper Left ( -11.1339000, 55.8714000) ( 11d 8’ 2.04"W, 55d52’17.04"N)
#Lower Left ( -11.1339000, 50.9251367) ( 11d 8’ 2.04"W, 50d55’30.49"N)
#Upper Right ( -4.8622296, 55.8714000) ( 4d51’44.03"W, 55d52’17.04"N)
#Lower Right ( -4.8622296, 50.9251367) ( 4d51’44.03"W, 50d55’30.49"N)
#Center ( -7.9980648, 53.3982684) ( 7d59’53.03"W, 53d23’53.77"N)
im = plt.imread(‘ireland_amo_2010284_geo.tif’)
extent = [left, right, bottom, top]
extent = [-11.1339000, -4.8622296, 50.9251367, 55.8714000]
m = bm.Basemap(projection=‘cyl’,
llcrnrlon=extent[0], urcrnrlon=extent[1],
llcrnrlat=extent[2], urcrnrlat=extent[3],
resolution='i')
plt.imshow(im, extent=extent)
m.drawcoastlines()
plt.show()
Your data appears to be a long way off. Are you certain of the bounds that you are setting? Are you using plt.imshow or doing some other operation to draw (e.g. contour)?
Cheers,
···
On 12 March 2013 15:00, Hearne, Mike <mhearne@…924…> wrote:
The relevant code is:
It’s kind of hard to post code that’s reproducible (lots of
dependencies on code and data), but I’ll attach an image at high
latitudes that demonstrates the problem.
The image is a shaded relief of topography, and the coastlines are
drawn in black.
The topography is cut from a large ESRI format BIL (Band Interleaved
by Line) file, and it’s bounds define the boundaries of the map. The
image data is NOT projected (it’s in lat/lon).
–Mike
On Tue, Mar 12, 2013 at 3:46 AM, Phil Elson <pelson.pub@…287…> wrote:
Hi Mike,
Do you have any code or an image to show the problem?
Cheers,
On 11 March 2013 20:44, Hearne, Mike <mhearne@…924…> wrote:
I have an issue with basemap.imshow() at higher latitudes - namely the
image (high-res topography, in this case) becomes distorted with
respect to the coastlines the higher I go. I assume it has to do
with the image pixels becoming more non-square the higher I go in
latitude.
I found this discussion:
http://matplotlib.1069221.n5.nabble.com/Basemap-and-imshow-td14115.html
where Jeff indicates that the user is using a non-rectangular map
projection. I’m thinking that is perhaps my problem (I’m using
Transverse Mercator), but I’m not sure which projections Basemap
supports that are rectangular.
Or perhaps it’s something else entirely.
Any hints?
Thanks,
Mike Hearne
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave™: Endpoint Security, Q1 2013 and “remains a good choice” in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users