1import numpy as np
2import pandas as pd
3import matplotlib.pyplot as plt
4
5df = pd.read_csv("filesc/file1.csv")
6df.head()
7
8BBox = ((df.x.min(), df.x.max(), df.y.min(), df.y.max()))
9
10ruh_m = plt.imread('map.png')
11
12print(BBox)
13
14fig, ax = plt.subplots(figsize = (8,7))
15ax.scatter(df.x, df.y, zorder=1, alpha= 0.2, c='b', s=10)
16ax.set_title('Plotting Spatial Data on Map')
17ax.set_xlim(BBox[0],BBox[1])
18ax.set_ylim(BBox[2],BBox[3])
19ax.imshow(ruh_m, zorder=0, extent = BBox, aspect= 'equal')
20plt.show()
21
22