【发布时间】:2021-08-02 15:27:19
【问题描述】:
这是我的代码:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
x = np.random.randint(1,100,100)
y = np.random.randint(-500,200,100)
plt.scatter(x, y)
ax = plt.gca()
ax.invert_yaxis()
x1, y1 = [0, 100], [-200, 0]
x2, y2 = [0, 0], [0, -200]
x3, y3 = [0, 100], [0, 0]
plt.plot(x1,y1,x2,y2,x3,y3, marker = 'o')
plt.show()
plt.show()
有两个问题
- 我希望三角形的手臂颜色相同,我该怎么做?
- 我想对三角形下方的区域进行阴影处理,使其半透明,即我可以看到三角形内部散点图的点。这可行吗?
【问题讨论】:
标签: python matplotlib plot scatter-plot