# Using PyMongo to create plotsimportpymongofrommpl_toolkits.mplot3dimportAxes3Dimportmatplotlib.pyplotaspltcourse_cluster_uri='your_connection_string'course_client=pymongo.MongoClient(course_cluster_uri)# sample datasetdb=course_client['sample_weatherdata']# sample collectionweather_data=db['data']# remove outliers that are clearly bad dataquery={'pressure.value':{'$lt':9999},'airTemperature.value':{'$lt':9999},'wind.speed.rate':{'$lt':500},}# convert our cursor into a listl=list(weather_data.find(query).limit(1000))# pull out the 3 variables we care# about into their own respective listspressures=[x['pressure']['value']forxinl]air_temps=[x['airTemperature']['value']forxinl]wind_speeds=[x['wind']['speed']['rate']forxinl]# here you'll write the code to plot pressures,# air_temps, and wind_speeds in a 3D plotplt.clf()fig=plt.figure()ax=fig.add_subplot(111,projection='3d')ax.scatter(pressures,air_temps,wind_speeds)ax.set_xlabel("Pressure")ax.set_ylabel("Air Temperature")ax.set_zlabel("Wind Speed")plt.show()