matplotlib-basemap

Matplotlib Basemap install issues mac OS

人走茶凉 提交于 2020-04-18 04:41:00
问题 I am trying to install basemap on my Mac. I followed the steps listed here: https://matplotlib.org/basemap/users/installing.html#installation Everything seemed to go well until I tried to test the install by typing into the python prompt: >>>from mpl_toolkits.basemap import Basemap Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.7/site- packages/mpl_toolkits/basemap/__init__.py", line 33, in <module> from mpl_toolkits.axes_grid1 import make_axes

Matplotlib Basemap: Removing Ocean

核能气质少年 提交于 2020-03-03 10:20:09
问题 I have an meshplot onto which I want to overlay continents in basemap. I am using this code: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt m = Basemap(width=12000000,height=9000000,projection='lcc', resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.) m.drawlsmask(land_color='coral',ocean_color='aqua',lakes=True) plt.show() referring to this, my requirements is opposite. I want continents ontop of the meshplot or image I have so only mesh at the ocean area is

matplotlib: preventing a few very large (or small) values to affect my contour

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-02 11:17:51
问题 in plotting the data some times there are a few very large (or very small) numbers which, if not taken care of, will affect the contour in a bad way. a solution is to take out the 10% highest and lowest data out of the contour color grading and considering them as less than and more than. the following figure shows the idea: the two arrow shapes on the top and the bottom of the bar support this idea. any value above 14 will be shown in white and any value below -2 will be shown in black color

VFR Sectional Aeronautical Charts with matplotlib (python)

北慕城南 提交于 2020-01-25 21:05:08
问题 I'm looking for a means to add VFR Sectional Aeronautical Charts (a.k.a. sectionals) to preexisting matplotlib code I have. In short, can there be a quick and easy means to realize sectional charts with python and matplotlib? If not, what are the other paths to consider? Reference: http://robertjliguori.blogspot.com/2016/10/acquiring-vfr-sectional-aeronautical.html Thanks, Robert 回答1: I actually figured it out... map = Basemap(...) map.arcgisimage(server='http://maps7.arcgisonline.com/ArcGIS'

Easiest way to plot data on country map with python

匆匆过客 提交于 2020-01-22 10:08:52
问题 Could not delete question. Please refer to question: Shade states of a country according to dictionary values with Basemap I want to plot data (number of sick people for a certain year) on each state of Mexico. I am using jupyter notebook. So far I have seen several options and tutorials, but none seem to seem to explicitly explain how to plot the map of a country. Below I explain some options/tutorial I have seen and why they have not worked (this I do just to argue that tutorials are not

Easiest way to plot data on country map with python

て烟熏妆下的殇ゞ 提交于 2020-01-22 10:08:29
问题 Could not delete question. Please refer to question: Shade states of a country according to dictionary values with Basemap I want to plot data (number of sick people for a certain year) on each state of Mexico. I am using jupyter notebook. So far I have seen several options and tutorials, but none seem to seem to explicitly explain how to plot the map of a country. Below I explain some options/tutorial I have seen and why they have not worked (this I do just to argue that tutorials are not

Installing basemap on Mac / Python

自古美人都是妖i 提交于 2020-01-19 12:16:15
问题 I'm having trouble to get the basemap to work in Python in my Mac. I keep receiving: from mpl_toolkits.basemap import basemap ImportError: No module named basemap What I did: brew install gdal brew install gets export GEOS_DIR=/usr/local/Cellar/geos/3.4.2/ basemap-1.0.7 $ python setup.py install I also tried: basemap-1.0.7 $ cd geos-3.3.3 basemap-1.0.7/geos-3.3.3 $ export GEOS_DIR=~/ basemap-1.0.7/geos-3.3.3 $ ./configure --prefix=$GEOS_DIR basemap-1.0.7/geos-3.3.3 $ make basemap-1.0.7/geos-3

How to project RGB multiband GeoTIFF to specified area extent using python?

為{幸葍}努か 提交于 2020-01-15 12:15:14
问题 I want to plot and RGB image (because it is satellite image) from multiband GeoTIFF and project it to specified area extent. Recently, I was successfully able to do this with single band raster using "georaster". However, when I tried to do the same for multiband raster, after calling image = georaster.MultiBandRaster(file, bands='all', load_data=extent) to load the subset data the same way as with georaster.SingleBandRaster, I get the following error: Traceback (most recent call last): File

Plotting data points onto matplotlib Basemap in Jupyter Notebook

强颜欢笑 提交于 2020-01-15 10:22:55
问题 Link to full code I am able to successfully create a Basemap of the US within a Jupyter Notebook complete with shapefile, coloring, and borders in Cell 4. I am trying to plot many data points onto this Basemap with the following line in Cell 8: m.plot(x, y, marker='o', markersize=data, color='#444444', alpha=0.8, latlon=True) The data gets plotted, but I lose all of my Basemap's formatting and shaping. Effectively, I want Cell 8 overlayed on Cell 4. I suspect I am not plotting these shapes on

How to make grouper and axis the same length?

柔情痞子 提交于 2020-01-13 20:20:08
问题 For my assignment I'm supposed to plot the tracks of 20 hurricanes on a map using matplotlib. However when I run my code I get the error: AssertionError:Grouper and axis must be the same length Here's the code I have: import numpy as np from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt from PIL import * fig = plt.figure(figsize=(12,12)) ax = fig.add_axes([0.1,0.1,0.8,0.8]) m = Basemap(llcrnrlon=-100.,llcrnrlat=0.,urcrnrlon=-20.,urcrnrlat=57., projection='lcc',lat_1=20.