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 8f2b84c

Browse filesBrowse files
committed
DOC: slightly update demo
Gets a frame rate of ~75fps on my machine
1 parent 6ee9a4d commit 8f2b84c
Copy full SHA for 8f2b84c

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-2
lines changed

‎examples/pylab_examples/system_monitor.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/system_monitor.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ def get_stats():
4040
ax.set_ylabel('Percent usage')
4141
ax.set_title('System Monitor')
4242

43+
start = time.time()
4344
for i in range(200): # run for a little while
4445
m, c, n = get_stats()
4546

4647
pm.set_height(m)
4748
pc.set_height(c)
4849
pn.set_height(n)
49-
ax.set_ylim([0, 100])
5050

51-
plt.draw()
51+
fig.canvas.flush_events()
52+
53+
stop = time.time()
54+
print("{fps:.1f} frames per second".format(fps=200 / (stop - start)))

0 commit comments

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