请问一下各位大佬,怎么用python 的matplotlib 在一定边界的长方形中画出500个点? 50
importmatplotlib.pyplotaspltimportrandomimportnumpyasnpplt.plot([104.3,111.3,111.3,10...
import matplotlib.pyplot as plt
import random
import numpy as np
plt.plot([104.3,111.3,111.3,104.3,104.3],[41,41,45,45,41],'black')
plt.xlabel('Longitude')
plt.ylabel('Lantitude')
rand_lat = random.uniform(41,45)
rand_lng = random.uniform(104.3,111.3)
plt.plot(rand_lng,rand_lat,'bo')
plt.show() 展开
import random
import numpy as np
plt.plot([104.3,111.3,111.3,104.3,104.3],[41,41,45,45,41],'black')
plt.xlabel('Longitude')
plt.ylabel('Lantitude')
rand_lat = random.uniform(41,45)
rand_lng = random.uniform(104.3,111.3)
plt.plot(rand_lng,rand_lat,'bo')
plt.show() 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询