/usr/lib/python2.7/dist-packages/cartopy/examples/star_shaped_boundary.py is in python-cartopy 0.14.2+dfsg1-2build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | """
Modifying the boundary/neatline of a map in cartopy
---------------------------------------------------
This example demonstrates how to modify the boundary/neatline
of an axes. We construct a star with coordinates in a Plate Carree
coordinate system, and use the star as the outline of the map.
Notice how changing the projection of the map represents a *projected*
star shaped boundary.
"""
__tags__ = ['Miscellanea']
import matplotlib.path as mpath
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
def main():
ax = plt.axes([0, 0, 1, 1], projection=ccrs.PlateCarree())
ax.coastlines()
# Construct a star in longitudes and latitudes.
star_path = mpath.Path.unit_regular_star(5, 0.5)
star_path = mpath.Path(star_path.vertices.copy() * 80,
star_path.codes.copy())
# Use the star as the boundary.
ax.set_boundary(star_path, transform=ccrs.PlateCarree())
plt.show()
if __name__ == '__main__':
main()
|