May-19-2018, 04:12 AM
I have to use the module matplotlib to plot a scatter graph on the map.
here is my codes
here is my codes
def map_of_sighting(altas_data): """this function is used to iterate through the data and extract the values of latitude and longtitude from each sighting,then these values will be ploted on the map""" starting_index = 1 latitude = [] longtitude = [] while starting_index < len(altas_data): latitude.append(altas_data[i][0]) longtitude.append(altas_data[i][1]) i=i+1 plt.imshow(mpimg.imread('map.png'),extent = [149.105, 149.130, -35.29, -35.27]) plt.scatter(latitude, longtitude) plt.show()it can be run, however, there is no any input of picture, i ran my codes in Pycharm and Jupyter notebook, it was the same situation.I am grateful for any help. Thanks in advance.