# -*- coding: utf-8 -*-
"""
Created on Tue Nov 16 20:38:41 2021
@author: Machi
"""
import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
%config InlineBackend.figure_format = 'retina'
np.random.seed(19680801)
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = (30 * np.random.rand(N))**2 # 0 to 15 point radii
plt.grid(True)
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()
用python画散点图
最新推荐文章于 2024-06-18 16:26:51 发布