matplotlib-basemap

Map based on Leaflet and AngularJS not loaded correctly

痴心易碎 提交于 2019-12-02 07:29:41
问题 My map based on Leaflet and AngularJS is not loading correctly. I do not know what's going on but the maps tiles are not laid out as they should be. This is the base map: This is my code: function setMapPosition(){ $scope.center = { lat: 51.505, lng: -0.09, zoom: 8 }; $scope.defaults= { scrollWheelZoom: false }; $scope.tiles = 'openstreetmap'; } 回答1: This problem often occurs due to resizing of any parent container while the map is already initialized. In order to tell the map that there was

Python: copy basemap or remove data from figure

天涯浪子 提交于 2019-12-02 04:38:45
I want to use a basemap figure as a background and plot things ontop. As the generation of the basemap figure (a polar stereographic plot) is quite time intensive I only want to do this once. The second step would be to draw some wind barbs on this plot and some other wind barbs on the same plot, but without the first set of barbs. Now either I copy the background image and then draw two different images or I can remove the first set of barbs and then draw the second, I don't mind which way to go. Unfortunately my brain is not helping me today and I am getting nowhere. I would be grateful for

Runtime error using python basemap and pyproj?

时光毁灭记忆、已成空白 提交于 2019-12-02 04:07:32
问题 I wrote a script using Spyder IDE with mpl_toolkits basemap to plot a GPS track as arrows for direction colored by speed. Everything worked fine until I upgraded pandas to 0.13. The data is like this: lon lat bearing speed m/s 2014-01-20 16:26:00 -170.681264 -14.290060 NaN NaN 2014-01-20 16:27:00 -170.681259 -14.290074 163.753636 0.026727 2014-01-20 16:28:00 -170.681259 -14.290074 180.000000 0.001172 2014-01-20 16:29:00 -170.681259 -14.290077 180.000000 0.004981 ll = [-14.294238,-170.683732]

Hatch area using pcolormesh in Basemap

主宰稳场 提交于 2019-12-02 03:05:53
问题 I try to hatch only the regions where I have statistically significant results. How can I do this using Basemap and pcolormesh? plt.figure(figsize=(12,12)) lons = iris_cube.coord('longitude').points lats = iris_cube.coord('latitude').points m = Basemap(llcrnrlon=lons[0], llcrnrlat=lats[0], urcrnrlon=lons[-1], urcrnrlat=lats[-1], resolution='l') lon, lat = np.meshgrid(lons, lats) plt.subplot(111) cs = m.pcolormesh(lon, lat, significant_data, cmap=cmap, norm=norm, hatch='/') 回答1: It seems

Runtime error using python basemap and pyproj?

雨燕双飞 提交于 2019-12-02 02:34:05
I wrote a script using Spyder IDE with mpl_toolkits basemap to plot a GPS track as arrows for direction colored by speed. Everything worked fine until I upgraded pandas to 0.13. The data is like this: lon lat bearing speed m/s 2014-01-20 16:26:00 -170.681264 -14.290060 NaN NaN 2014-01-20 16:27:00 -170.681259 -14.290074 163.753636 0.026727 2014-01-20 16:28:00 -170.681259 -14.290074 180.000000 0.001172 2014-01-20 16:29:00 -170.681259 -14.290077 180.000000 0.004981 ll = [-14.294238,-170.683732] ur = [-14.286362, -170.673260] gMap = Basemap(projection='merc', resolution='f', llcrnrlon=ll[1],

matplotlib Basemap plotting lat/long coordinates incorrectly

拟墨画扇 提交于 2019-12-02 01:36:42
问题 I am trying to learn matplotlib and the mapping function Basemap, and am trying to plot a simple list of lat/long coordinates on a map. However, the Basemap coordinate conversion to simple x/y coordinates are plotting points wildly off the map, and I can't work out why. My code is below: locationData = parseFile(locationFile) fig = plt.figure(figsize=(8,8)) m = Basemap(projection='merc', resolution='h', llcrnrlat=49, llcrnrlon=-13.5, urcrnrlat=59.5, urcrnrlon=4) m.drawcoastlines() m

Hatch area using pcolormesh in Basemap

前提是你 提交于 2019-12-02 01:19:04
I try to hatch only the regions where I have statistically significant results. How can I do this using Basemap and pcolormesh? plt.figure(figsize=(12,12)) lons = iris_cube.coord('longitude').points lats = iris_cube.coord('latitude').points m = Basemap(llcrnrlon=lons[0], llcrnrlat=lats[0], urcrnrlon=lons[-1], urcrnrlat=lats[-1], resolution='l') lon, lat = np.meshgrid(lons, lats) plt.subplot(111) cs = m.pcolormesh(lon, lat, significant_data, cmap=cmap, norm=norm, hatch='/') Ed Smith It seems pcolormesh does not support hatching (see https://github.com/matplotlib/matplotlib/issues/3058 ).

Map based on Leaflet and AngularJS not loaded correctly

无人久伴 提交于 2019-12-01 23:43:53
My map based on Leaflet and AngularJS is not loading correctly. I do not know what's going on but the maps tiles are not laid out as they should be. This is the base map: This is my code: function setMapPosition(){ $scope.center = { lat: 51.505, lng: -0.09, zoom: 8 }; $scope.defaults= { scrollWheelZoom: false }; $scope.tiles = 'openstreetmap'; } This problem often occurs due to resizing of any parent container while the map is already initialized. In order to tell the map that there was a resize you can call map.invalidateSize(); . It could also be that you didn't resize any parent container

matplotlib Basemap plotting lat/long coordinates incorrectly

情到浓时终转凉″ 提交于 2019-12-01 23:31:49
I am trying to learn matplotlib and the mapping function Basemap, and am trying to plot a simple list of lat/long coordinates on a map. However, the Basemap coordinate conversion to simple x/y coordinates are plotting points wildly off the map, and I can't work out why. My code is below: locationData = parseFile(locationFile) fig = plt.figure(figsize=(8,8)) m = Basemap(projection='merc', resolution='h', llcrnrlat=49, llcrnrlon=-13.5, urcrnrlat=59.5, urcrnrlon=4) m.drawcoastlines() m.drawmapboundary(fill_color='aqua') m.fillcontinents(color='green', lake_color='aqua') index=0 for entry in

Pandas error with basemap/proj for map plotting

与世无争的帅哥 提交于 2019-12-01 23:26:02
I ran the Python code below that is an example of "Plotting Maps: Visualizing Haiti Earthquake Crisis Data" on a book, Python for Data Analysis . Page 242-246 The code is supposed to create a plot map of Haiti but I got an error as below: Traceback (most recent call last): File "Haiti.py", line 74, in <module> x, y = m(cat_data.LONGITUDE, cat_data.LATITUDE) File "/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 1148, in __call__ xout,yout = self.projtran(x,y,inverse=inverse) File "/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/proj.py", line 286, in _