Skip to content

Commit

Permalink
commit version 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Winn1y committed Jun 4, 2023
1 parent 195d089 commit 1ffa317
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions 1 Scatter Plot/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@
plt.colorbar()
plt.show()


16 changes: 16 additions & 0 deletions 1 Scatter Plot/scatter_color.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import colors # 注意!为了调整“色盘”,需要导入colors

rng = np.random.RandomState(0)
x = rng.randn(50)
y = rng.randn(50)
color = rng.rand(50)
sizes = 700 * rng.rand(50)

changecolor = colors.Normalize(vmin=0.4, vmax=0.8)

plt.scatter(x, y, c=color, s=sizes, alpha=0.3, cmap='viridis',norm=changecolor)

plt.colorbar()
plt.show()
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,27 @@ Tips:**我们希望每周坚持分享一个小知识来积累可视化技术
![](pics/Cmap/DM_20230604164801_006.png)
![](pics/Cmap/DM_20230604164801_007.png)

### 带色盘演示
`
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import colors # 注意!为了调整“色盘”,需要导入colors

rng = np.random.RandomState(0)
x = rng.randn(50)
y = rng.randn(50)
color = rng.rand(50)
sizes = 700 * rng.rand(50)

changecolor = colors.Normalize(vmin=0.4, vmax=0.8)

plt.scatter(x, y, c=color, s=sizes, alpha=0.3, cmap='viridis',norm=changecolor)

plt.colorbar()
plt.show()
`
![](pics/Cmap/DM_20230604164801_008.png)

## Todo

- [X] 完成散点图函数说明及案例分析
Expand Down
Binary file added pics/Cmap/DM_20230604164801_008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1ffa317

Please sign in to comment.