Untitled
unknown
plain_text
10 days ago
1.5 kB
1
Indexable
Never
import matplotlib.pyplot as plt import geopandas as gpd from shapely.geometry import Point, Polygon # Load base map of India world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) india = world[world.name == "India"] # Create a basic outline of India fig, ax = plt.subplots(figsize=(10, 10)) india.boundary.plot(ax=ax, color='black') # Add points for the locations of Sunderbans, Kosi project, and 82 1/2 east longitude # Approximate coordinates sunderban = Point(88.5, 22.0) # Sunderbans (approximate location) kosi_project = Point(86.95, 25.8) # Kosi project (approximate location) longitude_82_5 = [(82.5, y) for y in range(8, 38)] # 82 1/2 east longitude # Plot the regions ax.scatter(*sunderban.xy, color='blue', label='Sunderban') ax.scatter(*kosi_project.xy, color='green', label='Kosi Project') # Mark the 82 1/2 east longitude line ax.plot([82.5]*len(range(8, 38)), range(8, 38), color='red', linestyle='--', label="82 1/2 East Longitude") # Highlighting the region of desert soil (approximate region of the Thar desert) desert_region = Polygon([(68, 23), (71, 23), (71, 28), (68, 28)]) # Approximate bounding box of Thar Desert desert = gpd.GeoSeries([desert_region]) desert.plot(ax=ax, color='yellow', alpha=0.4, label="Desert Soil") # Labels and legend ax.set_title('Outline Map of India with Specific Locations Marked', fontsize=15) ax.set_xlabel('Longitude') ax.set_ylabel('Latitude') plt.legend() # Show the plot plt.show()
Leave a Comment