为什么我的python散点图在使用“;s";参数

为什么我的python散点图在使用“;s";参数,python,matplotlib,scatter-plot,Python,Matplotlib,Scatter Plot,当我对气泡使用s参数时,整个绘图是红色的 当不使用s参数时,它显示恒定的气泡大小,但我希望气泡大小取决于总体 尝试使用较小的np\u pop: np_pop = np_pop/5000 # or any other value that decrease the population(?) 您是否尝试过使用非常小的np\u pop?我想泡泡太大了,覆盖了所有的图层,创造一个有助于我们解决问题的方法,我们必须在这一页上回答这个问题:“欢迎你,AkashSoni,请考虑通过点击答案左边的滴答来

当我对气泡使用s参数时,整个绘图是红色的

当不使用s参数时,它显示恒定的气泡大小,但我希望气泡大小取决于总体


尝试使用较小的
np\u pop

np_pop = np_pop/5000 # or any other value that decrease the population(?)

您是否尝试过使用非常小的
np\u pop
?我想泡泡太大了,覆盖了所有的图层,创造一个有助于我们解决问题的方法,我们必须在这一页上回答这个问题:“欢迎你,AkashSoni,请考虑通过点击答案左边的滴答来接受答案。”
# Import numpy as np
import numpy as np

# Store pop as a numpy array: np_pop
np_pop = np.array(pop)

# Double np_pop
np_pop = np_pop*2

# Update: set s argument to np_pop
plt.scatter(gdp_cap, life_exp ,alpha = 0.8,color ='red')

# Previous customizations
plt.xscale('log') 
plt.xlabel('GDP per Capita [in USD]')
plt.ylabel('Life Expectancy [in years]')
plt.title('World Development in 2007')
plt.xticks([1000, 10000, 100000],['1k', '10k', '100k'])

# Display the plot
plt.show()
np_pop = np_pop/5000 # or any other value that decrease the population(?)