Customization
12345678910111213141516171819202122# Import the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Reading the data data = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/ed80401e-2684-4bc4-a077-99d13a386ac7/gapminder2017.csv', index_col = 0) # Create Figure and Axes objects fig, ax = plt.subplots() # Initialize a scatter plot ax.scatter(data['gdp per capita'], data['internet users'], s = data['population']/1000000, c = 'red') # Set some parameters ax.set(ylim = (0, 50), xlim = (0, 20000), yticks = (0, 10, 20, 30, 40, 50), title = 'Example Plot', xlabel = 'GDP per capita', ylabel = '% of people with Internet access') # Display the plot plt.show()
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 5
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Awesome!
Completion rate improved to 2.94
Customization
Pyyhkäise näyttääksesi valikon
12345678910111213141516171819202122# Import the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Reading the data data = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/ed80401e-2684-4bc4-a077-99d13a386ac7/gapminder2017.csv', index_col = 0) # Create Figure and Axes objects fig, ax = plt.subplots() # Initialize a scatter plot ax.scatter(data['gdp per capita'], data['internet users'], s = data['population']/1000000, c = 'red') # Set some parameters ax.set(ylim = (0, 50), xlim = (0, 20000), yticks = (0, 10, 20, 30, 40, 50), title = 'Example Plot', xlabel = 'GDP per capita', ylabel = '% of people with Internet access') # Display the plot plt.show()
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 5