|
19 | 19 | "source": [ |
20 | 20 | "import networkx as nx\n", |
21 | 21 | "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", |
23 | 28 | "\n", |
24 | 29 | "G = nx.DiGraph()\n", |
25 | 30 | "G.add_node('A',pos=(0,100))\n", |
|
68 | 73 | "source": [ |
69 | 74 | "import networkx as nx\n", |
70 | 75 | "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", |
72 | 82 | "\n", |
73 | 83 | "G = nx.DiGraph()\n", |
74 | 84 | "G.add_node('A',pos=(0,100))\n", |
|
155 | 165 | "source": [ |
156 | 166 | "import networkx as nx\n", |
157 | 167 | "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", |
159 | 174 | "\n", |
160 | 175 | "G = nx.DiGraph()\n", |
161 | 176 | "G.add_node('A',pos=(0,100))\n", |
|
207 | 222 | "source": [ |
208 | 223 | "import networkx as nx\n", |
209 | 224 | "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", |
211 | 231 | "import pylab\n", |
212 | 232 | "\n", |
213 | 233 | "G = nx.DiGraph()\n", |
|
231 | 251 | " for u,v,d in G.edges(data=True)])\n", |
232 | 252 | "pos=nx.get_node_attributes(G,'pos')\n", |
233 | 253 | "\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", |
235 | 260 | "\n", |
236 | 261 | "plt.text(0,120,s='8', color='red', size=15, horizontalalignment='center')\n", |
237 | 262 | "plt.text(2.4,50,s='10', color='red', size=15, horizontalalignment='center')\n", |
|
0 commit comments