├── 1.png ├── 2.gif ├── 3.gif ├── 4.gif ├── 5.png ├── README.md └── matplotlib.js /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AirFin/JupyterNotebook_snippets_menu_Seaborn/ad1d3a6d5356157007d9c8723b366cc91d696c06/1.png -------------------------------------------------------------------------------- /2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AirFin/JupyterNotebook_snippets_menu_Seaborn/ad1d3a6d5356157007d9c8723b366cc91d696c06/2.gif -------------------------------------------------------------------------------- /3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AirFin/JupyterNotebook_snippets_menu_Seaborn/ad1d3a6d5356157007d9c8723b366cc91d696c06/3.gif -------------------------------------------------------------------------------- /4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AirFin/JupyterNotebook_snippets_menu_Seaborn/ad1d3a6d5356157007d9c8723b366cc91d696c06/4.gif -------------------------------------------------------------------------------- /5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AirFin/JupyterNotebook_snippets_menu_Seaborn/ad1d3a6d5356157007d9c8723b366cc91d696c06/5.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JupyterBotebook_snippets_menu_Seaborn 2 | 3 | ## 介绍 4 | 5 | ![1](1.png) 6 | 7 | 在JupyterBotebook中通过snippets menu插入Seaborn代码,快速方便进行数据可视化。 8 | 9 | 10 | 11 | snippets menu是一个在JupyterBotebook中插入常用代码的插件,方便快捷,详见https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/snippets_menu/readme.html 12 | 13 | 14 | 15 | 参考ApacheCN的seaborn 0.9中文文档https://seaborn.apachecn.org/进行编写,基本包括所有的seaborn图形以及常用参数及参数说明。 16 | 17 | 18 | 19 | 注:参数说明是用英文写的,但是很好理解。有不明白的地方,对照文档看一下即可。 20 | 21 | ## 使用 22 | 23 | 将下载的`matplotlib.js`文件复制到路径`D:\Anaconda3\share\jupyter\nbextensions\snippets_menu\snippets_submenus_python`下覆盖原文件即可。你的路径可能会有些许差异。 24 | 25 | 26 | 27 | 原来的`matplotlib.js`是用来插入matplotlib常用代码,比较少,我就修改了它。可以备份一份原始的`matplotlib.js`文件。 28 | 29 | 30 | 31 | ## 演示 32 | 33 | 34 | 35 | ![2](2.gif) 36 | 37 | 38 | 39 | ![3](3.gif) 40 | 41 | 42 | 43 | ![4](4.gif) 44 | 45 | 46 | 47 | ## 感谢 48 | 49 | 感谢ApacheCN对文档的翻译! 50 | --- 51 | 52 | 53 | ![5](5.png) 54 | 55 | 欢迎大家关注我的公众号:沙克芬 SharkFin 56 | 57 | 网站:[sharkfin.top](http://sharkfin.top) 58 | 59 | 语雀:[沙克芬——全学科网站导航](https://www.yuque.com/alipayqgthu1irbf/sharkfin) 60 | 61 | 知识星球:[沙克芬_稀有优质资源分享](https://t.zsxq.com/MJiIayN) 62 | 63 | --- 64 | 65 | # JupyterBotebook_snippets_menu_Seaborn 66 | 67 | ## Introduction 68 | 69 | ![1](1.png) 70 | 71 | Quickly and easily visualize data in JupyterBotebook by inserting Seaborn code through the snippets menu. 72 | 73 | The snippets menu is a convenient plug-in for inserting frequently used codes into JupyterBotebook. Click it https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/snippets_menu/readme.html 74 | 75 | 76 | 77 | Refer to ApacheCN's seaborn 0.9 Chinese documentation. Click it https://seaborn.apachecn.org/ It basically includes all Seaborn graphs, common parameters and parameter descriptions. 78 | 79 | 80 | 81 | Note: the parameter specification is written in English, but it is easy to understand. If you don't understand, please refer to the document. 82 | 83 | ## Use 84 | 85 | Copy the downloaded`matplotlib.js`file to path `D:\Anaconda3\share\jupyter\nbextensions\snippets_menu\snippets_submenus_python`and overwrite the original file. Your path may be a little different. 86 | 87 | 88 | 89 | The original `matplotlib.js` is used to insert common matplotlib code, which is not enough, so I modified it. You can make a backup copy of the original `matplotlib.js` file. 90 | 91 | 92 | 93 | ## Examples 94 | 95 | 96 | 97 | ![2](2.gif) 98 | 99 | 100 | 101 | ![3](3.gif) 102 | 103 | 104 | 105 | ![4](4.gif) 106 | 107 | 108 | 109 | ## Thanks 110 | 111 | Thanks to ApacheCN for translating the document! 112 | -------------------------------------------------------------------------------- /matplotlib.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "require", 3 | "./python_regex", 4 | ], function (requirejs, python_regex) { 5 | return { 6 | 'name' : 'Seaborn', 7 | 'sub-menu' : [ 8 | { 9 | 'name' : 'Start', 10 | 'snippet' : [ 11 | 'import matplotlib.pyplot as plt', 12 | 'import matplotlib as mpl', 13 | 'import seaborn as sns', 14 | ], 15 | }, 16 | { 17 | 'name' : 'Documentation-zh', 18 | 'external-link' : 'https://seaborn.apachecn.org/', 19 | }, 20 | { 21 | 'name' : 'GitHub', 22 | 'external-link' : 'https://github.com/SharkFin-top/JupyterNotebook_snippets_menu_Seaborn', 23 | }, 24 | '---', 25 | 26 | { 27 | 'name' : 'Visualizing statistical relationships', 28 | 'sub-menu' : [ 29 | { 30 | 'name' : 'replot scatter', 31 | 'snippet' : [ 32 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 33 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 34 | '# sns.despine() remove the top and right axes spines', 35 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 36 | '', 37 | '# hue=None, style=None, size=None, markers color, style and size', 38 | '# palette=\"Set3\" colors', 39 | '', 40 | 'replot_scatter_test = sns.relplot(kind=\"scatter\", data=None, x=None, y=None, hue=None, style=None, size=None, sizes=(15, 200), row=None, col=None)', 41 | ], 42 | }, 43 | { 44 | 'name' : 'replot line', 45 | 'snippet' : [ 46 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 47 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 48 | '# sns.despine() remove the top and right axes spines', 49 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 50 | '', 51 | '# estimator=None, turn off aggregation altogether', 52 | '# hue=None, style=None, size=None, lines color, style and size', 53 | '# palette=\"Set3\", colors', 54 | '', 55 | 'replot_scatter_test = sns.relplot(kind=\"line\", data=None, x=None, y=None, sort=True, ci=95, hue=None, style=None,size=None)', 56 | ], 57 | }, 58 | 59 | ], 60 | }, 61 | 62 | { 63 | 'name' : 'Plotting with categorical data', 64 | 'sub-menu' : [ 65 | { 66 | 'name' : 'catplot', 67 | 'snippet' : [ 68 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 69 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 70 | '# sns.despine() remove the top and right axes spines', 71 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 72 | '', 73 | '# kind = \"strip\" swarm, box, violin, boxen, point, bar, count', 74 | '', 75 | 'catplot_test = sns.catplot()', 76 | 77 | ], 78 | }, 79 | { 80 | 'name' : 'stripplot', 81 | 'snippet' : [ 82 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 83 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 84 | '# sns.despine() remove the top and right axes spines', 85 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 86 | '', 87 | '# palette=\"Set3\", colors', 88 | '# edgecolor=\"gray\"', 89 | '# jitter=True, or 0.05', 90 | '# dodge=True, seperate hue ', 91 | '# marker="D", size=20, ', 92 | '# order = [],', 93 | '', 94 | 'stripplot_test = sns.stripplot(data=tips, x=None, y=None, hue=None, jitter=True, dodge=False)', 95 | 96 | ], 97 | }, 98 | { 99 | 'name' : 'swarmplot', 100 | 'snippet' : [ 101 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 102 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 103 | '# sns.despine() remove the top and right axes spines', 104 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 105 | '', 106 | '# palette=\"Set3\", colors', 107 | '# edgecolor=\"gray\"', 108 | '# jitter=True, or 0.05', 109 | '# dodge=True, seperate hue ', 110 | '# marker="D", size=20, ', 111 | '# order = [],', 112 | '', 113 | 'swarmplot_test = sns.swarmplot(data=None, x=None, y=None, hue=None, jitter=True, dodge=False)', 114 | 115 | ], 116 | }, 117 | '---', 118 | { 119 | 'name' : 'boxplot', 120 | 'snippet' : [ 121 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 122 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 123 | '# sns.despine() remove the top and right axes spines', 124 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 125 | '', 126 | '# palette=\"Set3\", colors', 127 | '# order = [],', 128 | '# dodge=True, seperate hue ', 129 | '# notch=True, special Median', 130 | '# fliersize=0.5 size of outliers', 131 | '', 132 | 'boxplot_test = sns.boxplot(data=None, x=None, y=None, hue=None, orient=\"v\", dodge=False)', 133 | 134 | ], 135 | }, 136 | { 137 | 'name' : 'violinplot', 138 | 'snippet' : [ 139 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 140 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 141 | '# sns.despine() remove the top and right axes spines', 142 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 143 | '', 144 | '# palette=\"Set3\", colors', 145 | '# scale=\"count\" area, count, width', 146 | '# order = [],', 147 | '# dodge=True, seperate hue ', 148 | '# inner=\"box\" box, quartile, point, stick, None', 149 | '# split=False', 150 | '# bw=.2', 151 | '', 152 | 'violinplot_test = sns.violinplot(data=None, x=None, y=None, hue=None, orient=\"v\", dodge=False)', 153 | 154 | ], 155 | }, 156 | { 157 | 'name' : 'boxenplot', 158 | 'snippet' : [ 159 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 160 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 161 | '# sns.despine() remove the top and right axes spines', 162 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 163 | '', 164 | '# palette=\"Set3\", colors', 165 | '# order = [],', 166 | '# dodge=True, seperate hue ', 167 | '# scale=\"exponential\" area, linear, exponential SORRY,IT IS HARD FOR ME TO EXPLAIN IT', 168 | '# k_depth=\"proportion\" proportion, tukey, trustworthy SORRY,IT IS HARD FOR ME TO EXPLAIN IT', 169 | '', 170 | 'boxenplot_test = sns.boxenplot(data=None, x=None, y=None, hue=None, orient=\"v\", dodge=False)', 171 | 172 | ], 173 | }, 174 | '---', 175 | { 176 | 'name' : 'pointplot', 177 | 'snippet' : [ 178 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 179 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 180 | '# sns.despine() remove the top and right axes spines', 181 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 182 | '', 183 | '# palette=\"Set3\", colors', 184 | '# order = [],', 185 | '# dodge=True, seperate hue ', 186 | '# ci=None float, sd, None', 187 | '', 188 | 'pointplot_test = sns.pointplot(data=None, x=None, y=None, hue=None, markers=\"o\", linestyles=\"-\", orient=\"v\", dodge=False)', 189 | 190 | ], 191 | }, 192 | { 193 | 'name' : 'barplot', 194 | 'snippet' : [ 195 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 196 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 197 | '# sns.despine() remove the top and right axes spines', 198 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 199 | '', 200 | '# palette=\"Set3\", colors', 201 | '# order = [],', 202 | '# dodge=True, seperate hue ', 203 | '# ci=None float, sd, None', 204 | '# estimator=median', 205 | '', 206 | 'barplot_test = sns.barplot(data=None, x=None, y=None, hue=None, capsize=.2, markers=\"o\", linestyles=\"-\", orient=\"v\", dodge=True)', 207 | 208 | ], 209 | }, 210 | { 211 | 'name' : 'countplot', 212 | 'snippet' : [ 213 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 214 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 215 | '# sns.despine() remove the top and right axes spines', 216 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 217 | '', 218 | '# palette=\"Set3\", colors', 219 | '# order = [],', 220 | '# dodge=True, seperate hue ', 221 | '', 222 | 'countplot_test = sns.countplot(data=None, x=None, y=None, hue=None, capsize=.2, orient=\"v\", dodge=True)', 223 | 224 | ], 225 | }, 226 | ], 227 | }, 228 | 229 | { 230 | 'name' : 'Visualizing the distribution of a dataset', 231 | 'sub-menu' : [ 232 | { 233 | 'name' : 'distplot', 234 | 'snippet' : [ 235 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 236 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 237 | '# sns.despine() remove the top and right axes spines', 238 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 239 | '', 240 | '# palette=\"Set3\", colors', 241 | '# order = [],', 242 | '# dodge=True, seperate hue ', 243 | '', 244 | 'distplot_test = sns.distplot(x, hist=True, kde=True, rug=False, vertical=False)', 245 | 246 | ], 247 | }, 248 | { 249 | 'name' : 'kdeplot', 250 | 'snippet' : [ 251 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 252 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 253 | '# sns.despine() remove the top and right axes spines', 254 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 255 | '', 256 | '# palette=\"Set3\", colors', 257 | '# order = [],', 258 | '# dodge=True, seperate hue ', 259 | '# bw=.15', 260 | '', 261 | 'kdeplot_test_one = sns.kdeplot(x, shade=False, vertical=False,)', 262 | 'kdeplot_test_two = sns.kdeplot(x, y, shade=True ,n_levels=30, cmap="Blues",cbar=True)' 263 | 264 | ], 265 | }, 266 | { 267 | 'name' : 'rugplot', 268 | 'snippet' : [ 269 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 270 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 271 | '# sns.despine() remove the top and right axes spines', 272 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 273 | '', 274 | 'rugplot_test = sns.rugplot(x, height=0.05, axis=\"x\")', 275 | 276 | ], 277 | }, 278 | '---', 279 | { 280 | 'name' : 'jointplot', 281 | 'snippet' : [ 282 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 283 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 284 | '# sns.despine() remove the top and right axes spines', 285 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 286 | '', 287 | '# kind=\"scatter\" scatter, reg, resid, kde, hex', 288 | 'jointplot_test = sns.jointplot(data=None, x=None, y=None, kind=\"scatter\")', 289 | 290 | ], 291 | }, 292 | { 293 | 'name' : 'JointGrid', 294 | 'snippet' : [ 295 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 296 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 297 | '# sns.despine() remove the top and right axes spines', 298 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 299 | '', 300 | 'JointGrid_test = sns.JointGrid(data=None, x=None, y=None)', 301 | 'JointGrid_test = JointGrid_test.plot_joint(sns.regplot)', 302 | 'JointGrid_test = JointGrid_test.plot_marginals(sns.displot)', 303 | 304 | ], 305 | }, 306 | '---', 307 | { 308 | 'name' : 'pairplot', 309 | 'snippet' : [ 310 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 311 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 312 | '# sns.despine() remove the top and right axes spines', 313 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 314 | '', 315 | '# palette=\"Set3\", colors', 316 | '# kind=\"scatter\", scatter, reg', 317 | '# diag_kind=\"auto\", auto, hist, kde', 318 | 'vars=[],', 319 | '', 320 | 'pairplot_test = sns.pairplot(data=None, hue=None, hue_order=None, markers=\"o\")', 321 | 322 | ], 323 | }, 324 | { 325 | 'name' : 'PairGrid', 326 | 'snippet' : [ 327 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 328 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 329 | '# sns.despine() remove the top and right axes spines', 330 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 331 | '', 332 | '# palette=\"Set3\", colors', 333 | '# vars=[]', 334 | '# x_vars=[]', 335 | '# y_vars=[]', 336 | 337 | '# Start', 338 | 'PairGrid_test = sns.PairGrid(data=None, hue=None, hue_order=None,)', 339 | '# Way 1', 340 | 'PairGrid_test = PairGrid_test.map(sns.regplot) # every subplot', 341 | '# Way 2', 342 | 'PairGrid_test = PairGrid_test.map_diag(sns.displot) # every diag plot', 343 | 'PairGrid_test = PairGrid_test.map_offdiag(sns.regplot) # every not diag plot', 344 | '# Way 3', 345 | 'PairGrid_test = PairGrid_test.map_diag(sns.displot) # every diag plot', 346 | 'PairGrid_test = PairGrid_test.map_lower(sns.kdeplot) # every lower plot', 347 | 'PairGrid_test = PairGrid_test.map_upper(sns.regplot) # every upper plot', 348 | '', 349 | '# add legend', 350 | 'PairGrid_test = PairGrid_test.add_legend()', 351 | 352 | ], 353 | }, 354 | ], 355 | }, 356 | 357 | { 358 | 'name' : 'Visualizing linear relationships', 359 | 'sub-menu' : [ 360 | { 361 | 'name' : 'regplot', 362 | 'snippet' : [ 363 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 364 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 365 | '# sns.despine() remove the top and right axes spines', 366 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 367 | '', 368 | '# palette=\"Set3\", colors', 369 | '# edgecolor=\"gray\"', 370 | '', 371 | 'regplot_test = sns.regplot(data=None, x=None, y=None, order=1, robust=False, ci=95, markers=\"o\")', 372 | 373 | ], 374 | }, 375 | { 376 | 'name' : 'lmplot', 377 | 'snippet' : [ 378 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 379 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 380 | '# sns.despine() remove the top and right axes spines', 381 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 382 | '', 383 | '# palette=\"Set3\", colors', 384 | '# edgecolor=\"gray\"', 385 | '', 386 | 'lmplot_test = sns.lmplot(data=None, x=None, y=None, hue=None, col=None, row=None, order=1, robust=False,ci=95, marker=\"o\")', 387 | 388 | ], 389 | }, 390 | { 391 | 'name' : 'residplot', 392 | 'snippet' : [ 393 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 394 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 395 | '# sns.despine() remove the top and right axes spines', 396 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 397 | '', 398 | '# palette=\"Set3\", colors', 399 | '# edgecolor=\"gray\"', 400 | '', 401 | 'residplot_test = sns.residplot(data=tips, x=None, y=None, hue=None, order=1, robust=False,)', 402 | 403 | ], 404 | }, 405 | ], 406 | }, 407 | { 408 | 'name' : 'Building structured multi-plot grids', 409 | 'sub-menu' : [ 410 | { 411 | 'name' : 'FacetGrid', 412 | 'snippet' : [ 413 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 414 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 415 | '# sns.despine() remove the top and right axes spines', 416 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 417 | '', 418 | 'FacetGrid_test = sns.FacetGrid(data=None)', 419 | 'FacetGrid_test = FacetGrid_test.map()', 420 | 421 | ], 422 | }, 423 | ], 424 | }, 425 | { 426 | 'name' : 'Other Plots', 427 | 'sub-menu' : [ 428 | { 429 | 'name' : 'heatmap', 430 | 'snippet' : [ 431 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 432 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 433 | '# sns.despine() remove the top and right axes spines', 434 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 435 | '', 436 | 'heatmap_test = sns.heatmap(data=None, cmap="YlGnBu", annot=None,linewidths=.5)', 437 | 438 | ], 439 | }, 440 | { 441 | 'name' : 'clustermap', 442 | 'snippet' : [ 443 | 'sns.set(font_scale=1.5, font=\"SimHei\")', 444 | 'sns.set_style(\"darkgrid\") # , whitegrid, dark, white, ticks', 445 | '# sns.despine() remove the top and right axes spines', 446 | 'plt.figure(figsize=(20, 10)) # or fig.set_size_inches(20, 10) or XXX.fig.set_size_inches(20, 10)', 447 | '', 448 | '# IT IS HARD FOR ME TO EXPLAIN IT, SORRY', 449 | 'clustermap_test = sns.clustermap(data=None)', 450 | 451 | ], 452 | }, 453 | ], 454 | }, 455 | ], 456 | }; 457 | }); 458 | --------------------------------------------------------------------------------