N1H111SM's Miniverse

Matplotlib Cookbook

字数统计: 60阅读时长: 1 min
2020/06/07 Share

3D Drawing

1
2
3
4
fig = plt.gcf()  
ax = fig.add_subplot(241, projection='3d')

# TODO: Drawing code here.

Dynamic Drawing

In Jupyter Notebook: use display in Ipython

1
2
3
4
5
6
7
8
9
10
11
12
from IPython import display

for _ in range(10):
# clear the current figure first
plt.clf()

# TODO: Drawing code here.

# wait=True avoid picture on&off.
display.display(plt.gcf())
display.clear_output(wait=True)
time.sleep(0.1)
CATALOG
  1. 1. 3D Drawing
  2. 2. Dynamic Drawing