Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c35781e

Browse filesBrowse files
author
ugurthemaster
committed
Update scatter_demo.py
colors added
1 parent d1cb803 commit c35781e
Copy full SHA for c35781e

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎examples/shapes_and_collections/scatter_demo.py

Copy file name to clipboardExpand all lines: examples/shapes_and_collections/scatter_demo.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
N = 50
99
x = np.random.rand(N)
1010
y = np.random.rand(N)
11+
colors = np.random.rand(N)
1112
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radiuses
1213

13-
plt.scatter(x, y, s=area, alpha=0.5)
14+
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
1415
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.