|
From: Scott S. <sco...@gm...> - 2010-11-11 14:04:10
|
On 11 November 2010 14:59, andres luhamaa <and...@gm...> wrote:
> Thanks, it really works with QT4Agg!
> Still, I think it would be better, if it worked with default GTKAgg as
> well. But my understanging of the whole matplotlib code is probably too
> general to submit a bug report somewhere.
A good start is always a self contained script illustrating the problem.
I don't have GTKAgg installed here to try. Does the script below
reproduce your problem? If so, maybe someone else can reproduce it and
will take an interest in finding a fix..
Cheers,
Scott
------------------------------------------
import matplotlib as mpl
mpl.use('GTKAgg')
from mpl_toolkits import basemap
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
title = 'Backend: %s - mpl version: %s - basemap version: %s' % \
(mpl.get_backend(), mpl.__version__, basemap.__version__)
lat_0=58.5
lon_0=25.5
width=400000
height=400000
m=Basemap(projection='aeqd',lat_0=lat_0,
lon_0=lon_0,width=width,height=height,resolution='i')
m.drawmeridians(range(20,30),labels=[0,0,1,0])
m.drawparallels(range(45,65),labels=[1,0,0,0])
## what I expect to be map center
X,Y=m(lon_0,lat_0)
m.plot([X],[Y],'ko')
plt.text(X,Y,'expected centre')
## actual map center
X,Y=m(int(lon_0),int(lat_0))
m.plot([X],[Y],'ro')
plt.text(X,Y,'centre with GTKAgg')
plt.suptitle(title)
plt.show()
|