All Questions
100 questions
12
votes
5
answers
9k
views
Plot only on continent in matplotlib
I am drawing a map using basemap from matplotlib. The data are spreaded all over the world, but I just want to retain all the data on the continent and drop those on the ocean. Is there a way that I ...
50
votes
18
answers
149k
views
Python basemap module impossible to import
I have troubles to import the basemap module of mpl_toolkits in python. Here is what I get when I run the test.py script from the module directory:
/usr/lib/python2.7/dist-packages/mpl_toolkits/...
24
votes
3
answers
35k
views
Fill countries in python basemap
Hi I am trying to plot a map using pythons basemap with some countries filled in a certain colour.
Is there a quick and easy solution out there??
52
votes
7
answers
13k
views
why does my colorbar have lines in it?
Edit: Since this seems to be a popular post, here's the solution that seems to be working well for me. Thanks @gazzar and @mfra.
cbar.solids.set_rasterized(True)
cbar.solids.set_edgecolor("face")
...
9
votes
2
answers
11k
views
How to remove/omit smaller contour lines using matplotlib
I am trying to plot contour lines of pressure level. I am using a netCDF file which contain the higher resolution data (ranges from 3 km to 27 km). Due to higher resolution data set, I get lot of ...
7
votes
1
answer
7k
views
Matplotlib basemap: Popup box
I want to know how to create a popup box in a basemap plot. When I hover my mouse over a location , it should trigger the popup box.
Is this possible?
3
votes
1
answer
5k
views
How to show shapefile label in python basemap legend?
The python Basemap has two contents plotted in it: A multiline shapefile (IL_State_ln) and a scatterplot of some random points within the basemap extent. My interest is in generating a legend that ...
27
votes
2
answers
20k
views
Python Matplotlib Basemap overlay small image on map plot
I am plotting data from an aircraft on a map and I would like to insert this 75px by 29px PNG image of an airplane at the coordinates of the latest data point on the plot.
As far as I know and have ...
12
votes
2
answers
27k
views
Matplotlib: draw a selection area in the shape of a rectangle with the mouse
I want to be able to draw a selection area on a matplotlib plot with a mouse event. I didn't find information on how to do it with python.
In the end, I want to be able to draw a region of interest ...
2
votes
2
answers
2k
views
Plotting shapefile using LineCollection shows all edges, but partially fills them
For the past few days I have been trying to get weather station data interpolated in a map for my country only. I do this as follows:
Loading the data, I create a grid using interpolation
Based on ...
26
votes
2
answers
32k
views
Draw polygons more efficiently with matplotlib
I have a dateset of around 60000 shapes (with lat/lon coordinates of each corner) which I want to draw on a map using matplotlib and basemap.
This is the way I am doing it at the moment:
for ii in ...
24
votes
2
answers
50k
views
How to insert scale bar in a map in matplotlib
Any ideas on how can I insert a scale bar in a map in matplotlib that shows the length scale? something like the one I have attached.
Or maybe any ideas on measuring and showing distances ...
5
votes
1
answer
4k
views
scatter plot data does not appear on continents in 'hammer' basemap
I am attempting to plot a dataset over the 'hammer' basemap using a scatter plot. However, the data points won't plot on top of the continents. I noticed in the matplotlib example, there is also not ...
1
vote
3
answers
531
views
IndexError with Basemap.contour() when using certain projections
I have run into problems when using Basemap.contour with certain projections. Based on the example given in the Basemap documentation, I created the following working code which produces the expected ...
32
votes
5
answers
22k
views
Is it possible to control matplotlib marker orientation?
If I have a triangular marker, is it possible to control its orientation? I have a series of facets, with their corresponding vertices, and I would like to plot a basemap of them. I know it is ...