Skip to content

Commit 992bbe5

Browse files
committed
update networks
1 parent 4e12f01 commit 992bbe5

File tree

10 files changed

+70
-65
lines changed

10 files changed

+70
-65
lines changed

lectures/_static/lecture_specific/networks/figures.ipynb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@
109109
"source": [
110110
"dot = Digraph(format='png',engine = \"neato\")\n",
111111
"dot.attr(rankdir='LR')\n",
112-
"dot.node(\"poor\", pos='0,0!')\n",
113-
"dot.node(\"middle class\", pos='2,1!')\n",
114-
"dot.node(\"rich\", pos='4,0!')\n",
112+
"dot.node(\"贫困\", pos='0,0!')\n",
113+
"dot.node(\"中产\", pos='2,1!')\n",
114+
"dot.node(\"富裕\", pos='4,0!')\n",
115115
"\n",
116-
"dot.edge(\"poor\", \"poor\")\n",
117-
"dot.edge(\"poor\", \"middle class\")\n",
118-
"dot.edge(\"middle class\", \"poor\")\n",
119-
"dot.edge(\"middle class\", \"middle class\")\n",
120-
"dot.edge(\"middle class\", \"rich\")\n",
121-
"dot.edge(\"rich\", \"poor\")\n",
122-
"dot.edge(\"rich\", \"middle class\")\n",
123-
"dot.edge(\"rich\", \"rich\")\n",
116+
"dot.edge(\"贫困\", \"贫困\")\n",
117+
"dot.edge(\"贫困\", \"中产\")\n",
118+
"dot.edge(\"中产\", \"贫困\")\n",
119+
"dot.edge(\"中产\", \"中产\")\n",
120+
"dot.edge(\"中产\", \"富裕\")\n",
121+
"dot.edge(\"富裕\", \"贫困\")\n",
122+
"dot.edge(\"富裕\", \"中产\")\n",
123+
"dot.edge(\"富裕\", \"富裕\")\n",
124124
"\n",
125125
"dot\n",
126126
"dot.render(filename='poverty_trap_1')"
@@ -146,17 +146,17 @@
146146
"source": [
147147
"dot = Digraph(format='png',engine=\"neato\")\n",
148148
"dot.attr(rankdir='LR')\n",
149-
"dot.node(\"poor\", pos='0,0!')\n",
150-
"dot.node(\"middle class\", pos='2,1!')\n",
151-
"dot.node(\"rich\", pos='4,0!')\n",
149+
"dot.node(\"贫困\", pos='0,0!')\n",
150+
"dot.node(\"中产\", pos='2,1!')\n",
151+
"dot.node(\"富裕\", pos='4,0!')\n",
152152
"\n",
153-
"dot.edge(\"poor\", \"poor\")\n",
154-
"dot.edge(\"middle class\", \"poor\")\n",
155-
"dot.edge(\"middle class\", \"middle class\")\n",
156-
"dot.edge(\"middle class\", \"rich\")\n",
157-
"dot.edge(\"rich\", \"poor\")\n",
158-
"dot.edge(\"rich\", \"middle class\")\n",
159-
"dot.edge(\"rich\", \"rich\")\n",
153+
"dot.edge(\"贫困\", \"贫困\")\n",
154+
"dot.edge(\"中产\", \"贫困\")\n",
155+
"dot.edge(\"中产\", \"中产\")\n",
156+
"dot.edge(\"中产\", \"富裕\")\n",
157+
"dot.edge(\"富裕\", \"贫困\")\n",
158+
"dot.edge(\"富裕\", \"中产\")\n",
159+
"dot.edge(\"富裕\", \"富裕\")\n",
160160
"\n",
161161
"dot\n",
162162
"dot.render(filename='poverty_trap_2')"
@@ -191,18 +191,18 @@
191191
"dot = Digraph(format='png')\n",
192192
"\n",
193193
"dot.attr(rankdir='LR')\n",
194-
"dot.node(\"poor\")\n",
195-
"dot.node(\"middle class\")\n",
196-
"dot.node(\"rich\")\n",
194+
"dot.node(\"贫困\")\n",
195+
"dot.node(\"中产\")\n",
196+
"dot.node(\"富裕\")\n",
197197
"\n",
198-
"dot.edge(\"poor\", \"poor\", label='0.9')\n",
199-
"dot.edge(\"poor\", \"middle class\", label='0.1')\n",
200-
"dot.edge(\"middle class\", \"poor\", label='0.4')\n",
201-
"dot.edge(\"middle class\", \"middle class\", label='0.4')\n",
202-
"dot.edge(\"middle class\", \"rich\", label='0.2')\n",
203-
"dot.edge(\"rich\", \"poor\", label='0.1')\n",
204-
"dot.edge(\"rich\", \"middle class\", label='0.1')\n",
205-
"dot.edge(\"rich\", \"rich\", label='0.8')\n",
198+
"dot.edge(\"贫困\", \"贫困\", label='0.9')\n",
199+
"dot.edge(\"贫困\", \"中产\", label='0.1')\n",
200+
"dot.edge(\"中产\", \"贫困\", label='0.4')\n",
201+
"dot.edge(\"中产\", \"中产\", label='0.4')\n",
202+
"dot.edge(\"中产\", \"富裕\", label='0.2')\n",
203+
"dot.edge(\"富裕\", \"贫困\", label='0.1')\n",
204+
"dot.edge(\"富裕\", \"中产\", label='0.1')\n",
205+
"dot.edge(\"富裕\", \"富裕\", label='0.8')\n",
206206
"\n",
207207
"dot\n",
208208
"dot.render(filename='weighted')"
4.47 KB
Loading
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
digraph {
22
rankdir=LR
3-
poor [pos="0,0!"]
4-
"middle class" [pos="2,1!"]
5-
rich [pos="4,0!"]
6-
poor -> poor
7-
poor -> "middle class"
8-
"middle class" -> poor
9-
"middle class" -> "middle class"
10-
"middle class" -> rich
11-
rich -> poor
12-
rich -> "middle class"
13-
rich -> rich
3+
"贫困" [pos="0,0!"]
4+
"中产" [pos="2,1!"]
5+
"富裕" [pos="4,0!"]
6+
"贫困" -> "贫困"
7+
"贫困" -> "中产"
8+
"中产" -> "贫困"
9+
"中产" -> "中产"
10+
"中产" -> "富裕"
11+
"富裕" -> "贫困"
12+
"富裕" -> "中产"
13+
"富裕" -> "富裕"
1414
}
-2.04 KB
Loading
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
digraph {
22
rankdir=LR
3-
poor [pos="0,0!"]
4-
"middle class" [pos="2,1!"]
5-
rich [pos="4,0!"]
6-
poor -> poor
7-
"middle class" -> poor
8-
"middle class" -> "middle class"
9-
"middle class" -> rich
10-
rich -> poor
11-
rich -> "middle class"
12-
rich -> rich
3+
"贫困" [pos="0,0!"]
4+
"中产" [pos="2,1!"]
5+
"富裕" [pos="4,0!"]
6+
"贫困" -> "贫困"
7+
"中产" -> "贫困"
8+
"中产" -> "中产"
9+
"中产" -> "富裕"
10+
"富裕" -> "贫困"
11+
"富裕" -> "中产"
12+
"富裕" -> "富裕"
1313
}
-2.27 KB
Loading
-922 Bytes
Loading
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
digraph {
22
rankdir=LR
3-
poor
4-
"middle class"
5-
rich
6-
poor -> poor [label=0.9]
7-
poor -> "middle class" [label=0.1]
8-
"middle class" -> poor [label=0.4]
9-
"middle class" -> "middle class" [label=0.4]
10-
"middle class" -> rich [label=0.2]
11-
rich -> poor [label=0.1]
12-
rich -> "middle class" [label=0.1]
13-
rich -> rich [label=0.8]
3+
"贫困"
4+
"中产"
5+
"富裕"
6+
"贫困" -> "贫困" [label=0.9]
7+
"贫困" -> "中产" [label=0.1]
8+
"中产" -> "贫困" [label=0.4]
9+
"中产" -> "中产" [label=0.4]
10+
"中产" -> "富裕" [label=0.2]
11+
"富裕" -> "贫困" [label=0.1]
12+
"富裕" -> "中产" [label=0.1]
13+
"富裕" -> "富裕" [label=0.8]
1414
}
-2.26 KB
Loading

lectures/networks.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ import quantecon_book_networks.input_output as qbn_io
4444
import quantecon_book_networks.data as qbn_data
4545
4646
import matplotlib.patches as mpatches
47+
48+
import matplotlib as mpl
49+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
50+
mpl.font_manager.fontManager.addfont(FONTPATH)
51+
plt.rcParams['font.family'] = ['Source Han Serif SC']
4752
```
4853

4954
## 经济和金融网络
@@ -752,7 +757,7 @@ df = centrality_plot_data(countries, indegree)
752757
753758
ax.bar('code', 'centrality', data=df, color=df["color"], alpha=0.6)
754759
755-
patch = mpatches.Patch(color=None, label='in degree', visible=False)
760+
patch = mpatches.Patch(color=None, label='入度', visible=False)
756761
ax.legend(handles=[patch], fontsize=12, loc="upper left", handlelength=0, frameon=False)
757762
758763
ax.set_ylim((0,20))

0 commit comments

Comments
 (0)