import ogr
import pylab
from numpy import asarray

from shapely.wkb import loads

source = ogr.Open("/var/gis/data/world/world_borders.shp")
borders = source.GetLayerByName("world_borders")

fig = pylab.figure(1, figsize=(4,2), dpi=300)

while 1:
    feature = borders.GetNextFeature()
    if not feature:
        break
    
    geom = loads(feature.GetGeometryRef().ExportToWkb())
    a = asarray(geom)
    pylab.plot(a[:,0], a[:,1])

pylab.show()

Add example of connecting OGR to matplotlib through shapely and numpy
Add example of connecting OGR to matplotlib through shapely and numpy

git-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145
