SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Jonathan_Kowalik <jon...@na...> - 2014年04月29日 15:36:05
Hi.
I also asked this question on stackoverflow, but I think it might even
better to ask it here.
I'm doing basemap plots. The current coordinates of the mouse pointer are
interactively displayed in the lower right area of the figure. But they are
in map coordinates (I assume). I would like to have them in lng/lat.
Is there a quick way to do this?
Do I have to dive into mouse events (which I'm not familiar with yet)?
Thanks!
Jonathan
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Interactively-get-readable-i-e-lng-lat-coordinates-from-a-matplotlib-basemap-plot-tp43328.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
I already got the answer:
 ax = plt.gca()
 def format_coord(x, y):
 return 'x=%.4f, y=%.4f'%(m(x, y, inverse = True))
 ax.format_coord = format_coord
This does exactly what I wanted. :-)
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Interactively-get-readable-i-e-lng-lat-coordinates-from-a-matplotlib-basemap-plot-tp43328p43330.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /