Questions tagged [matplotlib]

If you are thinking about using this tag then perhaps reconsider whether your question would be better posted to Stack Overflow because "matplotlib is a python 2D plotting library" rather than GIS software.

Filter by
Sorted by
Tagged with
37
votes
4answers
25k views

Simple thematic mapping of shapefile using Python?

I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map. On the internet I found how to make a thematic map using Python: Here is some code that I tried: ...
13
votes
6answers
41k views

Plot shapefile with matplotlib

I am trying to read a shapefile and plot it using matplotlib. Here is the code: import matplotlib.pyplot as plt import shapefile shpFilePath = "D:\test.shp" listx=[] listy=[] test = shapefile....
7
votes
1answer
10k views

Display a georeferenced DEM surface in 3D matplotlib

I want to use a DEM file to generate a simulated terrain surface using matplotlib. But I do not know how to georeference the raster coordinates to a given CRS. Nor do I know how to express the ...
7
votes
1answer
5k views

Plot shapefile on top of raster using plot and imshow from matplotlib

I need to plot a shapefile on top of a raster. I would like to use the python package rasterio and some combination of fiona or geopandas to load the shapefile. I found an example in the rasterio ...
5
votes
2answers
9k views

Converting Matplotlib contour objects to Shapely objects

I would like to convert a Matplotlib contour collection to a Shapely geometry collection, in order to calculate the area contained within closed contour lines. it seems that all the information is ...
1
vote
2answers
3k views

RuntimeError while executing python

After downloading Matplotlib to use the Statist Pugin An error has occured while executing Python code: RuntimeError: module compiled against API version 9 but this version of numpy is 6 Python ...
-3
votes
1answer
2k views

Plot a surface with a DEM and mplot3d [closed]

I want to plot a surface on Python with a DEM that I made on QGIS. I found 2 posts on this topic which were published by the same person: GIS Stackexchange: on this post they show us how to obtain a ...
7
votes
2answers
3k views

DEM plot with matplotlib is too slow

I made a surface plot with matplotlib, mplot3d and gdal. Here is the code: import gdal from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import matplotlib.pyplot as plt import numpy ...
4
votes
4answers
5k views

Plotting large shapefiles with matplotlib

I'm writing a little GIS tool in Python and I want to display shapefiles. I've successfully gotten matplotlib working using this answer, but it is very slow and heavy to load any shapefile that ...
2
votes
0answers
1k views

Create map (image) from raster and vector in Python - problem with big files

I wrote function which allows me to plot raster and (optionally) plot vector on the same image. It works for small files, but in case of big rasters, I receive memmory error. I've tried to add ...
0
votes
1answer
2k views

Plotting 3D Data using Python?

I have a Uniform Grid of 1KMx1KM squares as a shapefile with population data in each grid in a specific column as an integer. I would like to extrude each polygon based on the population and export ...
5
votes
2answers
1k views

matplotlib does not work in ArcGIS 10 and Eclipse (Python)

I have installed matplotlib (v. 1.0.1) which works with iPython quite good. But if I insert the same script in ArcGIS 10 or Eclipse 3.7.0 (with PyDev) I get always errors. As I consider to use ...
2
votes
1answer
3k views

Plotting “large” image with points with matplotlib - MemoryError

I want to plot an image of 3193 x 3293 pixels with 1502 points. When running in a smaller image and less points (934,722 pixels and 60 points), everything runs perfectly. I wrote like this: # I am ...