Skip to content

Commit c4c4b86

Browse files
committed
update matplotlib
1 parent 650e540 commit c4c4b86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+407
-7
lines changed

lectures/_static/lecture_specific/mccall/mccall_resw_alpha.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import matplotlib.pyplot as plt
2+
import matplotlib as mpl
3+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
4+
mpl.font_manager.fontManager.addfont(FONTPATH)
5+
plt.rcParams['font.family'] = ['Source Han Serif SC']
6+
27

38
grid_size = 25
49
α_vals = np.linspace(0.05, 0.5, grid_size)

lectures/_static/lecture_specific/mccall/mccall_resw_gamma.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import matplotlib.pyplot as plt
2+
import matplotlib as mpl
3+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
4+
mpl.font_manager.fontManager.addfont(FONTPATH)
5+
plt.rcParams['font.family'] = ['Source Han Serif SC']
6+
27

38
grid_size = 25
49
γ_vals = np.linspace(0.05, 0.95, grid_size)

lectures/_static/lecture_specific/mccall/mccall_vf_plot1.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import matplotlib.pyplot as plt
2+
import matplotlib as mpl
3+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
4+
mpl.font_manager.fontManager.addfont(FONTPATH)
5+
plt.rcParams['font.family'] = ['Source Han Serif SC']
6+
27

38
mcm = McCallModel()
49
V, U = solve_mccall_model(mcm)

lectures/_static/lecture_specific/short_path/Graph-networkx2.ipynb

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"source": [
2020
"import networkx as nx\n",
2121
"import numpy as np\n",
22-
"import matplotlib.pyplot as plt\n",
22+
"import matplotlib.pyplot as plt
23+
import matplotlib as mpl
24+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
25+
mpl.font_manager.fontManager.addfont(FONTPATH)
26+
plt.rcParams['font.family'] = ['Source Han Serif SC']
27+
\n",
2328
"\n",
2429
"G = nx.DiGraph()\n",
2530
"G.add_node('A',pos=(0,100))\n",
@@ -68,7 +73,12 @@
6873
"source": [
6974
"import networkx as nx\n",
7075
"import numpy as np\n",
71-
"import matplotlib.pyplot as plt\n",
76+
"import matplotlib.pyplot as plt
77+
import matplotlib as mpl
78+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
79+
mpl.font_manager.fontManager.addfont(FONTPATH)
80+
plt.rcParams['font.family'] = ['Source Han Serif SC']
81+
\n",
7282
"\n",
7383
"G = nx.DiGraph()\n",
7484
"G.add_node('A',pos=(0,100))\n",
@@ -155,7 +165,12 @@
155165
"source": [
156166
"import networkx as nx\n",
157167
"import numpy as np\n",
158-
"import matplotlib.pyplot as plt\n",
168+
"import matplotlib.pyplot as plt
169+
import matplotlib as mpl
170+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
171+
mpl.font_manager.fontManager.addfont(FONTPATH)
172+
plt.rcParams['font.family'] = ['Source Han Serif SC']
173+
\n",
159174
"\n",
160175
"G = nx.DiGraph()\n",
161176
"G.add_node('A',pos=(0,100))\n",
@@ -207,7 +222,12 @@
207222
"source": [
208223
"import networkx as nx\n",
209224
"import numpy as np\n",
210-
"import matplotlib.pyplot as plt\n",
225+
"import matplotlib.pyplot as plt
226+
import matplotlib as mpl
227+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
228+
mpl.font_manager.fontManager.addfont(FONTPATH)
229+
plt.rcParams['font.family'] = ['Source Han Serif SC']
230+
\n",
211231
"import pylab\n",
212232
"\n",
213233
"G = nx.DiGraph()\n",
@@ -231,7 +251,12 @@
231251
" for u,v,d in G.edges(data=True)])\n",
232252
"pos=nx.get_node_attributes(G,'pos')\n",
233253
"\n",
234-
"import matplotlib.pyplot as plt\n",
254+
"import matplotlib.pyplot as plt
255+
import matplotlib as mpl
256+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
257+
mpl.font_manager.fontManager.addfont(FONTPATH)
258+
plt.rcParams['font.family'] = ['Source Han Serif SC']
259+
\n",
235260
"\n",
236261
"plt.text(0,120,s='8', color='red', size=15, horizontalalignment='center')\n",
237262
"plt.text(2.4,50,s='10', color='red', size=15, horizontalalignment='center')\n",

lectures/aiyagari.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ tags: [hide-output]
5656

5757
```{code-cell} ipython
5858
import matplotlib.pyplot as plt
59+
import matplotlib as mpl
60+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
61+
mpl.font_manager.fontManager.addfont(FONTPATH)
62+
plt.rcParams['font.family'] = ['Source Han Serif SC']
63+
5964
plt.rcParams["figure.figsize"] = (11, 5) #设置默认图形大小
6065
import numpy as np
6166
from quantecon.markov import DiscreteDP

lectures/ak2.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ $$
379379
```{code-cell} ipython3
380380
import numpy as np
381381
import matplotlib.pyplot as plt
382+
import matplotlib as mpl
383+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
384+
mpl.font_manager.fontManager.addfont(FONTPATH)
385+
plt.rcParams['font.family'] = ['Source Han Serif SC']
386+
382387
from numba import jit
383388
from quantecon.optimize import brent_max
384389
```

lectures/amf_var.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import scipy.linalg as la
44
import quantecon as qe
55
import matplotlib.pyplot as plt
6+
import matplotlib as mpl
7+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
8+
mpl.font_manager.fontManager.addfont(FONTPATH)
9+
plt.rcParams['font.family'] = ['Source Han Serif SC']
10+
611
from scipy.stats import norm, lognorm
712

813

lectures/ar1_bayes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ import numpy as np
3131
import jax.numpy as jnp
3232
from jax import random
3333
import matplotlib.pyplot as plt
34+
import matplotlib as mpl
35+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
36+
mpl.font_manager.fontManager.addfont(FONTPATH)
37+
plt.rcParams['font.family'] = ['Source Han Serif SC']
38+
3439
3540
import logging
3641
logging.basicConfig()

lectures/ar1_turningpts.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ import numpy as np
4444
import arviz as az
4545
import pymc as pmc
4646
import matplotlib.pyplot as plt
47+
import matplotlib as mpl
48+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
49+
mpl.font_manager.fontManager.addfont(FONTPATH)
50+
plt.rcParams['font.family'] = ['Source Han Serif SC']
51+
4752
import seaborn as sns
4853
4954
sns.set_style('white')

lectures/bayes_nonconj.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ kernelspec:
5050
import numpy as np
5151
import seaborn as sns
5252
import matplotlib.pyplot as plt
53+
import matplotlib as mpl
54+
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
55+
mpl.font_manager.fontManager.addfont(FONTPATH)
56+
plt.rcParams['font.family'] = ['Source Han Serif SC']
57+
5358
from scipy.stats import binom
5459
import scipy.stats as st
5560
import torch

0 commit comments

Comments
 (0)