# -*- coding: utf-8 -*- """ Created on Mon Nov 21 11:06:01 2022 @author: cpresser """ import matplotlib.pyplot as plt import numpy as np import meteorite masses = np.array([ meteorite.data[i][3] for i in range(len(meteorite.data))]) #data, bins #binInfo = plt.hist(masses, 10, range=(0,100)) #binInfo returns a list of the counts and #min value of each bin #for l in binInfo: # print(l) #break into two sub plots: rows, columns #make them share a y-axis fig, axs = plt.subplots(1, 2, sharey=True) #set up each sub plot with a histogram axs[0].hist(masses, 10, color="orange") axs[1].hist(masses, 10, range=(0,100)) plt.show() #start another plot - lat v long lat = np.array([ meteorite.data[i][6] for i in range(len(meteorite.data))]) long = np.array([ meteorite.data[i][7] for i in range(len(meteorite.data))]) #build a scatter plot plt.scatter(long, lat, color="red") #set up axes plt.axis([-180, 180, -90, 90]) #create an image background #read the image data img = plt.imread("worldMap.jpeg") #display the image plt.imshow(img, extent=(-180, 180, -90, 90)) plt.show()