Questions tagged [matplotlib-basemap]

The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python. It is similar in functionality to the matlab mapping toolbox, the IDL mapping facilities, GrADS, or the Generic Mapping Tools. PyNGL and CDAT are other libraries that provide similar capabilities in Python.

Homepage: http://matplotlib.github.com/basemap/

Basemap does not do any plotting on its own, but provides the facilities to transform coordinates to one of 25 different map projections (using the PROJ4 C library). Matplotlib is then used to plot contours, images, vectors, lines or points in the transformed coordinates. Shoreline, river and political boundary datasets (from Generic Mapping Tools) are provided, along with methods for plotting them. The GEOS library is used internally to clip the coastline and political boundary features to the desired map projection region.

Basemap provides facilities for reading shape files.

Basemap is geared toward the needs of earth scientists, particularly oceanographers and meteorologists. The author originally wrote Basemap to help in his research (climate and weather forecasting), since at the time CDAT was the only other tool in python for plotting data on map projections. Over the years, the capabilities of Basemap have evolved as scientists in other disciplines (such as biology, geology and geophysics) requested and contributed new features.

Deprecation Notice: As seen at the home page, "Basemap is deprecated in favor of the Cartopy project." See here for more information.

1245 questions
0
votes
2 answers

matplotlib mouseclick event in pie chart

Is there a way in matplotlib and Python to return the value/label clicked in a pie chart. For example if user clicks on sliver A of pie chart, return value A. If user clicks on sliver B of B pie chart, return value B.
user1314011
  • 153
  • 2
  • 5
  • 12
0
votes
0 answers

wxpython and updating matplotlib figure in panel

I am using a wx gui with basemap and matplotlib. I have two panels (left/right). I plot a map of the US in my right panel. This occurs no problem with the code below: # Setup the Map for Display self.figure = Figure(None,dpi=75) self.canvas =…
mcfly
  • 1,151
  • 4
  • 33
  • 55
0
votes
1 answer

Changing borders in matplotlib basemap

I would like to change the political borders of countries in Basemap permanently. How do I go about doing it ?
Andy Stow Away
  • 649
  • 1
  • 8
  • 17
-1
votes
1 answer

Cartopy issue in polar stereographic projection

The issue only happens with contourf, not with pcolormesh. How can I fix the discontinuity at longitude=0 (white stripe in the plot)?
peteron30
  • 69
  • 7
-1
votes
1 answer

pip install geos or basemap - fail to install

Can anyone help please, I'm trying to install geos and basemap in jupyter notebooks but getting the same error for both. Selections of output posted below. × Running setup.py install for lxml did not run successfully. │ exit code: 1 ╰─> [93…
Tez
  • 45
  • 2
  • 7
-1
votes
1 answer

Creating numpy array where values are within the range of two other arranges of the same size

I have created a map of a particular climate variable, which has been produced by extracting data from netCDF4 files and converting them into mask arrays. The data is the ensemble mean of 9 CMIP6 models. I would like to plot over the top of this…
-1
votes
3 answers

netCDF4 and Basemap package on Python 3.7

I hope someone can help me with this. I am plotting netcdf data on a map using the mpl_toolkits.basemap and netCDF4.Dataset packages. They worked perfectly a few month ago and I successfully plotted what I wanted. Now I want to update my work with…
-1
votes
1 answer

How to map 3D spherical point configuration (not the earth) onto 2D plane?

I have a 3d spherical point set of 10 points, (2 layers of pentagonal loudspeaker array) 2. I want to obtain 2D representation of this configuration. (Mollweide, Mercator, Cylindirical or Equirectangular projection?) I will set the axis so that they…
-1
votes
1 answer

How to convert the information from a shapefile from polygon to lat/lon

I need to make a scatter plot over a map. I have the shapefile to plot the map but I need to convert the information of shapefile (polygon) to lon and lat coordinates. This is my code: borough =…
-1
votes
2 answers

How to show the labels of each scatter point in a basemap?

This is my code: fig = plt.figure(figsize=(12, 8), dpi=300) m = Basemap(width=20000,height=15000,resolution='c',projection='lcc',lon_0=-0.09,lat_0=51.49) m.drawcoastlines(linewidth=0.5) m.fillcontinents(color='tan',lake_color='lightblue') # draw…
Alexa
  • 99
  • 1
  • 6
-1
votes
1 answer

How do I install basemap on Kaggle? Can someone provide the code?

I am trying to install higher resolution Basemap (basemap-data-hires)and the pip commands I am finding don't seem to work. Thanks! OSError: Unable to open boundary dataset file. Only the 'crude' and 'low', resolution datasets are installed by…
-1
votes
1 answer

Convert a shapefile to geographic coordinates

Very new to geospatial data - I'm currently working to get a set of postcodes labelled within their correct geographical region, as defined by NUTS1. I figured the best way of doing this would be to: Get the coordinates of the NUTS1…
-1
votes
1 answer

How to plot corner points of geographical coordinates derived from rotated coordinates

I have the coordinates of the four corner of my domain in rotated coordinate. These are rlons: -25.6, 32.48, -25.6, 32.48 rlats: -27.6, -27.6, 26.08, 26.08 the rotated north pole is lon -170, lat 40 First I have to transform the corners from…
Vinod Kumar
  • 1,383
  • 1
  • 12
  • 26
-1
votes
1 answer

Cartopy plot high/low sea level pressure on map

I'm migrating from basemap to cartopy. One thing I would like to do is plot high/low pressure on a map, such as in basemap. There is a good example on this page of how to do this: https://matplotlib.org/basemap/users/examples.html ("Plot sea-level…
J W
  • 617
  • 1
  • 9
  • 28
-1
votes
1 answer

Change data source from THREDDS Catalouge for NetCDF

Hi i am using this code from here How to read NetCDF file and write to CSV using Python I want to be able to pull out the "Mean_period_of_swell_waves_ordered_sequence_of_data" from from the THREDDS Catalog here but am recieving the below error. I am…
1 2 3
82
83