API¶
plotfig.bar ¶
plot_one_group_bar_figure ¶
plot_one_group_bar_figure(data, ax=None, labels_name=None, width=0.5, colors=None, dots_size=35, dots_color=None, title_name='', x_label_name='', y_label_name='', statistic=False, test_method='ttest_ind', p_list=None, errorbar_type='se', **kwargs)
绘制单组柱状图,包含散点和误差条。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | list[NumArray] | 包含多个数据集的列表,每个数据集是一个数字数组。 | required |
ax | Axes | None | matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前的 Axes。 | None |
labels_name | list[str] | None | 每个数据集的标签名称。默认为 None,使用索引作为标签。 | None |
width | Num | 柱子的宽度。默认为 0.5。 | 0.5 |
colors | list[str] | None | 每个柱子的颜色。默认为 None,使用灰色。 | None |
dots_size | Num | 散点的大小。默认为 35。 | 35 |
dots_color | list[list[str]] | None | 每个数据集中散点的颜色。默认为 None,使用灰色。 | None |
title_name | str | 图表的标题。默认为空字符串。 | '' |
x_label_name | str | X 轴的标签。默认为空字符串。 | '' |
y_label_name | str | Y 轴的标签。默认为空字符串。 | '' |
statistic | bool | 是否进行统计检验并标注显著性标记。默认为 False。 | False |
test_method | str | 统计检验的方法,支持 "ttest_ind"、"ttest_rel" 和 "mannwhitneyu"。默认为 "ttest_ind"。 | 'ttest_ind' |
p_list | list[float] | None | 外部提供的 p 值列表,用于统计检验。默认为 None。 | None |
errorbar_type | str | 误差条类型,支持 "sd"(标准差)和 "se"(标准误)。默认为 "se"。 | 'se' |
**kwargs | Any | 其他可选参数,用于进一步定制图表样式。 | {} |
Returns:
Type | Description |
---|---|
None | None |
Source code in src/plotfig/bar.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
plot_one_group_violin_figure ¶
plot_one_group_violin_figure(data, ax=None, labels_name=None, width=0.8, colors=None, show_dots=False, dots_size=35, title_name='', x_label_name='', y_label_name='', statistic=False, test_method='ttest_ind', p_list=None, show_means=False, show_extrema=True, **kwargs)
绘制单组小提琴图,包含散点和统计显著性标记。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | list[NumArray] | 包含多个数据集的列表,每个数据集是一个数字数组。 | required |
ax | Axes | None | matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前的 Axes。 | None |
labels_name | list[str] | None | 每个数据集的标签名称。默认为 None,使用索引作为标签。 | None |
width | Num | 小提琴图的宽度。默认为 0.8。 | 0.8 |
colors | list[str] | None | 每个小提琴图的颜色。默认为 None,使用灰色。 | None |
show_dots | bool | 是否显示散点。默认为 False。 | False |
dots_size | Num | 散点的大小。默认为 35。 | 35 |
title_name | str | 图表的标题。默认为空字符串。 | '' |
x_label_name | str | X 轴的标签。默认为空字符串。 | '' |
y_label_name | str | Y 轴的标签。默认为空字符串。 | '' |
statistic | bool | 是否进行统计检验并标注显著性标记。默认为 False。 | False |
test_method | str | 统计检验的方法,支持 "ttest_ind"、"ttest_rel" 和 "mannwhitneyu"。默认为 "ttest_ind"。 | 'ttest_ind' |
p_list | list[float] | None | 外部提供的 p 值列表,用于统计检验。默认为 None。 | None |
show_means | bool | 是否显示均值线。默认为 False。 | False |
show_extrema | bool | 是否显示极值线。默认为 True。 | True |
**kwargs | Any | 其他可选参数,用于进一步定制图表样式。 | {} |
Returns:
Type | Description |
---|---|
None | None |
Source code in src/plotfig/bar.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
|
plot_multi_group_bar_figure ¶
plot_multi_group_bar_figure(data, ax=None, bar_width=0.2, bar_gap=0.1, bar_color=None, errorbar_type='se', dots_color='gray', dots_size=35, group_labels=None, bar_labels=None, title_name='', y_label_name='', statistic=False, test_method='external', p_list=None, legend=True, legend_position=(1.2, 1), **kwargs)
绘制多组柱状图,包含散点和误差条。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | list[list[NumArray]] | 包含多个组的数据,每组是一个数据集列表,每个数据集是一个数字数组。 | required |
ax | Axes | None | matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前的 Axes。 | None |
bar_width | Num | 每个柱子的宽度。默认为 0.2。 | 0.2 |
bar_gap | Num | 柱子之间的间隙。默认为 0.1。 | 0.1 |
bar_color | list[str] | None | 每个柱子的颜色。默认为 None,使用灰色。 | None |
errorbar_type | str | 误差条类型,支持 "sd"(标准差)和 "se"(标准误)。默认为 "se"。 | 'se' |
dots_color | str | 散点的颜色。默认为 "gray"。 | 'gray' |
dots_size | int | 散点的大小。默认为 35。 | 35 |
group_labels | list[str] | None | 每组的标签名称。默认为 None,使用 "Group i" 作为标签。 | None |
bar_labels | list[str] | None | 每个柱子的标签名称。默认为 None,使用 "Bar i" 作为标签。 | None |
title_name | str | 图表的标题。默认为空字符串。 | '' |
y_label_name | str | Y 轴的标签。默认为空字符串。 | '' |
statistic | bool | 是否进行统计检验并标注显著性标记。默认为 False。 | False |
test_method | str | 统计检验的方法,支持 "external"(外部提供 p 值)和其他方法。默认为 "external"。 | 'external' |
p_list | list[list[Num]] | None | 外部提供的 p 值列表,用于统计检验。默认为 None。 | None |
legend | bool | 是否显示图例。默认为 True。 | True |
legend_position | tuple[Num, Num] | 图例的位置。默认为 (1.2, 1)。 | (1.2, 1) |
**kwargs | Any | 其他可选参数,用于进一步定制图表样式。 | {} |
Returns:
Type | Description |
---|---|
None | None |
Source code in src/plotfig/bar.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
|
plotfig.correlation ¶
plot_correlation_figure ¶
plot_correlation_figure(data1, data2, ax=None, stats_method='spearman', ci=False, dots_color='steelblue', dots_size=1, line_color='r', title_name='', title_fontsize=10, title_pad=10, x_label_name='', x_label_fontsize=10, x_tick_fontsize=10, x_tick_rotation=0, x_major_locator=None, x_max_tick_to_value=None, x_format='normal', y_label_name='', y_label_fontsize=10, y_tick_fontsize=10, y_tick_rotation=0, y_major_locator=None, y_max_tick_to_value=None, y_format='normal', asterisk_fontsize=10, show_p_value=False)
绘制两个数据集之间的相关性图,支持线性回归、置信区间和统计方法(Spearman 或 Pearson)。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data1 | list[Num] | ndarray | 第一个数据集,可以是整数或浮点数列表或数组。 | required |
data2 | list[Num] | ndarray | 第二个数据集,可以是整数或浮点数列表或数组。 | required |
ax | Axes | None | matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前 Axes。 | None |
stats_method | str | 相关性统计方法,支持 "spearman" 和 "pearson"。默认为 "spearman"。 | 'spearman' |
ci | bool | 是否绘制置信区间带。默认为 False。 | False |
dots_color | str | 散点的颜色。默认为 "steelblue"。 | 'steelblue' |
dots_size | int | float | 散点的大小。默认为 1。 | 1 |
line_color | str | 回归线的颜色。默认为 "r"(红色)。 | 'r' |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 10。 | 10 |
title_pad | int | 标题与图形之间的间距。默认为 10。 | 10 |
x_label_name | str | X 轴标签名称。默认为空字符串。 | '' |
x_label_fontsize | int | X 轴标签字体大小。默认为 10。 | 10 |
x_tick_fontsize | int | X 轴刻度标签字体大小。默认为 10。 | 10 |
x_tick_rotation | int | X 轴刻度标签旋转角度。默认为 0。 | 0 |
x_major_locator | float | None | 设置 X 轴主刻度间隔。默认为 None。 | None |
x_max_tick_to_value | float | None | 设置 X 轴最大显示刻度值。默认为 None。 | None |
x_format | str | X 轴格式化方式,支持 "normal", "sci", "1f", "percent"。默认为 "normal"。 | 'normal' |
y_label_name | str | Y 轴标签名称。默认为空字符串。 | '' |
y_label_fontsize | int | Y 轴标签字体大小。默认为 10。 | 10 |
y_tick_fontsize | int | Y 轴刻度标签字体大小。默认为 10。 | 10 |
y_tick_rotation | int | Y 轴刻度标签旋转角度。默认为 0。 | 0 |
y_major_locator | float | None | 设置 Y 轴主刻度间隔。默认为 None。 | None |
y_max_tick_to_value | float | None | 设置 Y 轴最大显示刻度值。默认为 None。 | None |
y_format | str | Y 轴格式化方式,支持 "normal", "sci", "1f", "percent"。默认为 "normal"。 | 'normal' |
asterisk_fontsize | int | 显著性星号字体大小。默认为 10。 | 10 |
show_p_value | bool | 是否显示 p 值。默认为 True。 | False |
Returns:
Type | Description |
---|---|
None | None |
Source code in src/plotfig/correlation.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
|
plotfig.matrix ¶
plot_matrix_figure ¶
plot_matrix_figure(data, ax=None, row_labels_name=None, col_labels_name=None, cmap='bwr', vmin=None, vmax=None, aspect='equal', colorbar=True, colorbar_label_name='', colorbar_pad=0.1, colorbar_label_fontsize=10, colorbar_tick_fontsize=10, colorbar_tick_rotation=0, row_labels_fontsize=10, col_labels_fontsize=10, x_rotation=60, title_name='', title_fontsize=15, title_pad=20, diag_border=False, **imshow_kwargs)
Plot a matrix as a heatmap with optional labels, colorbar, and title.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray | 2D array of shape (N, M) to display as the matrix. | required |
ax | Axes | None | Matplotlib axes to plot on. If None, uses current axes. | None |
row_labels_name | Sequence[str] | None | List of labels for the rows. | None |
col_labels_name | Sequence[str] | None | List of labels for the columns. | None |
cmap | str | Colormap to use for the matrix. | 'bwr' |
vmin | Num | None | Minimum value for color scaling. Defaults to data.min(). | None |
vmax | Num | None | Maximum value for color scaling. Defaults to data.max(). | None |
aspect | str | Aspect ratio of the plot. Usually "equal" or "auto". | 'equal' |
colorbar | bool | Whether to show a colorbar. | True |
colorbar_label_name | str | Label for the colorbar. | '' |
colorbar_pad | Num | Padding between the colorbar and the matrix. | 0.1 |
colorbar_label_fontsize | Num | Font size of the colorbar label. | 10 |
colorbar_tick_fontsize | Num | Font size of the colorbar ticks. | 10 |
colorbar_tick_rotation | Num | Rotation angle of the colorbar tick labels. | 0 |
row_labels_fontsize | Num | Font size for the row labels. | 10 |
col_labels_fontsize | Num | Font size for the column labels. | 10 |
x_rotation | Num | Rotation angle for the x-axis (column) labels. | 60 |
title_name | Num | Title of the plot. | '' |
title_fontsize | Num | Font size of the title. | 15 |
title_pad | Num | Padding above the title. | 20 |
diag_border | bool | Whether to draw borders along the diagonal cells. | False |
**imshow_kwargs | Any | Additional keyword arguments for | {} |
Returns:
Name | Type | Description |
---|---|---|
AxesImage | AxesImage | The image object created by |
Source code in src/plotfig/matrix.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
plotfig.circos ¶
plot_asymmetric_circle_figure ¶
plot_asymmetric_circle_figure(connectome, labels=None, node_colors=None, vmin=None, vmax=None, figsize=(10, 10), labels_fontsize=15, face_color='w', nodeedge_color='w', text_color='k', cmap='bwr', linewidth=1, title_name='', title_fontsize=20, colorbar=False, colorbar_size=0.2, colorbar_fontsize=10, colorbar_pos=(0, 0), manual_colorbar=False, manual_colorbar_pos=(1, 0.4, 0.01, 0.2), manual_cmap='bwr', manual_colorbar_name='', manual_colorbar_label_fontsize=10, manual_colorbar_fontsize=10, manual_colorbar_rotation=-90, manual_colorbar_pad=20, manual_colorbar_draw_border=True, manual_colorbar_tickline=False, manual_colorbar_nticks=False)
绘制类circos连接图
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connectome | NDArray | 连接矩阵. | required |
labels | list[str] | None | 节点名称. Defaults to None. | None |
node_colors | list[str] | None | 节点颜色. Defaults to None. | None |
vmin | Num | None | 最小值. Defaults to None. | None |
vmax | Num | None | 最大值. Defaults to None. | None |
figsize | Tuple[Num, Num] | 图大小. Defaults to (10, 10). | (10, 10) |
labels_fontsize | Num | 节点名字大小. Defaults to 15. | 15 |
face_color | str | 图背景颜色. Defaults to "w". | 'w' |
nodeedge_color | str | 节点轮廓颜色. Defaults to "w". | 'w' |
text_color | str | 文本颜色. Defaults to "k". | 'k' |
cmap | str | colorbar颜色. Defaults to "bwr". | 'bwr' |
linewidth | Num | 连接线宽度. Defaults to 1. | 1 |
title_name | str | 图标题名称. Defaults to "". | '' |
title_fontsize | Num | 图标题字体大小. Defaults to 20. | 20 |
colorbar | bool | 是否绘制colorbar. Defaults to False. | False |
colorbar_size | Num | colorbar大小. Defaults to 0.2. | 0.2 |
colorbar_fontsize | Num | colorbar字体大小. Defaults to 10. | 10 |
colorbar_pos | Tuple[Num, Num] | colorbar位置. Defaults to (0, 0). | (0, 0) |
manual_colorbar | bool | 高级colorbar. Defaults to False. | False |
manual_colorbar_pos | Tuple[Num, Num, Num, Num] | 高级colorbar位置. Defaults to (1, 0.4, 0.01, 0.2). | (1, 0.4, 0.01, 0.2) |
manual_cmap | str | 高级colorbar cmap. Defaults to "bwr". | 'bwr' |
manual_colorbar_name | str | 高级colorbar名字. Defaults to "". | '' |
manual_colorbar_label_fontsize | Num | 高级colorbar label字体大小. Defaults to 10. | 10 |
manual_colorbar_fontsize | Num | 高级colorbar字体大小. Defaults to 10. | 10 |
manual_colorbar_rotation | Num | 高级colorbar旋转. Defaults to -90. | -90 |
manual_colorbar_pad | Num | 高级colorbar标题间隔距离. Defaults to 20. | 20 |
manual_colorbar_draw_border | bool | 高级colorbar轮廓. Defaults to True. | True |
manual_colorbar_tickline | bool | 高级colorbar tick线. Defaults to False. | False |
manual_colorbar_nticks | bool | 高级colorbar tick数量. Defaults to False. | False |
Returns:
Type | Description |
---|---|
Figure | plt.Figure: description |
Source code in src/plotfig/circos.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
plot_symmetric_circle_figure ¶
plot_symmetric_circle_figure(connectome, labels=None, node_colors=None, vmin=None, vmax=None, figsize=(10, 10), labels_fontsize=15, face_color='w', nodeedge_color='w', text_color='k', cmap='bwr', linewidth=1, title_name='', title_fontsize=20, colorbar=False, colorbar_size=0.2, colorbar_fontsize=10, colorbar_pos=(0, 0), manual_colorbar=False, manual_colorbar_pos=(1, 0.4, 0.01, 0.2), manual_cmap='bwr', manual_colorbar_name='', manual_colorbar_label_fontsize=10, manual_colorbar_fontsize=10, manual_colorbar_rotation=-90, manual_colorbar_pad=20, manual_colorbar_draw_border=True, manual_colorbar_tickline=False, manual_colorbar_nticks=False)
绘制类circos连接图
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connectome | NDArray | 连接矩阵. | required |
labels | list[str] | None | 节点名称. Defaults to None. | None |
node_colors | list[str] | None | 节点颜色. Defaults to None. | None |
vmin | Num | None | 最小值. Defaults to None. | None |
vmax | Num | None | 最大值. Defaults to None. | None |
figsize | Tuple[Num, Num] | 图大小. Defaults to (10, 10). | (10, 10) |
labels_fontsize | Num | 节点名字大小. Defaults to 15. | 15 |
face_color | str | 图背景颜色. Defaults to "w". | 'w' |
nodeedge_color | str | 节点轮廓颜色. Defaults to "w". | 'w' |
text_color | str | 文本颜色. Defaults to "k". | 'k' |
cmap | str | colorbar颜色. Defaults to "bwr". | 'bwr' |
linewidth | Num | 连接线宽度. Defaults to 1. | 1 |
title_name | str | 图标题名称. Defaults to "". | '' |
title_fontsize | Num | 图标题字体大小. Defaults to 20. | 20 |
colorbar | bool | 是否绘制colorbar. Defaults to False. | False |
colorbar_size | Num | colorbar大小. Defaults to 0.2. | 0.2 |
colorbar_fontsize | Num | colorbar字体大小. Defaults to 10. | 10 |
colorbar_pos | Tuple[Num, Num] | colorbar位置. Defaults to (0, 0). | (0, 0) |
manual_colorbar | bool | 高级colorbar. Defaults to False. | False |
manual_colorbar_pos | Tuple[Num, Num, Num, Num] | 高级colorbar位置. Defaults to (1, 0.4, 0.01, 0.2). | (1, 0.4, 0.01, 0.2) |
manual_cmap | str | 高级colorbar cmap. Defaults to "bwr". | 'bwr' |
manual_colorbar_name | str | 高级colorbar名字. Defaults to "". | '' |
manual_colorbar_label_fontsize | Num | 高级colorbar label字体大小. Defaults to 10. | 10 |
manual_colorbar_fontsize | Num | 高级colorbar字体大小. Defaults to 10. | 10 |
manual_colorbar_rotation | Num | 高级colorbar旋转. Defaults to -90. | -90 |
manual_colorbar_pad | Num | 高级colorbar标题间隔距离. Defaults to 20. | 20 |
manual_colorbar_draw_border | bool | 高级colorbar轮廓. Defaults to True. | True |
manual_colorbar_tickline | bool | 高级colorbar tick线. Defaults to False. | False |
manual_colorbar_nticks | bool | 高级colorbar tick数量. Defaults to False. | False |
Returns:
Type | Description |
---|---|
Figure | plt.Figure: description |
Source code in src/plotfig/circos.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
plotfig.brain_surface ¶
plot_chimpanzee_brain_figure ¶
plot_chimpanzee_brain_figure(data, surf='veryinflated', atlas='bna', vmin=None, vmax=None, plot=True, cmap='Reds', colorbar=True, colorbar_location='right', colorbar_label_name='', colorbar_label_rotation=0, colorbar_decimals=1, colorbar_fontsize=8, colorbar_nticks=2, colorbar_shrink=0.15, colorbar_aspect=8, colorbar_draw_border=False, title_name='', title_fontsize=15, title_y=0.9, rjx_colorbar=False, rjx_colorbar_direction='vertical', horizontal_center=True, rjx_colorbar_outline=False, rjx_colorbar_label_name='', rjx_colorbar_tick_fontsize=10, rjx_colorbar_label_fontsize=10, rjx_colorbar_tick_rotation=0, rjx_colorbar_tick_length=0, rjx_colorbar_nticks=2)
绘制黑猩猩大脑表面图,支持 BNA 图谱。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, float] | 包含 ROI 名称及其对应值的字典。 | required |
surf | str | 大脑表面类型(如 "veryinflated", "midthickness")。默认为 "veryinflated"。 | 'veryinflated' |
atlas | str | 使用的图谱名称,目前仅支持 "bna"。默认为 "bna"。 | 'bna' |
vmin | Num | 颜色映射的最小值。可以是整数或浮点数。默认为 None。 | None |
vmax | Num | 颜色映射的最大值。可以是整数或浮点数。默认为 None。 | None |
plot | bool | 是否直接绘制图形。默认为 True。 | True |
cmap | str | 颜色映射方案。默认为 "Reds"。 | 'Reds' |
colorbar | bool | 是否显示颜色条。默认为 True。 | True |
colorbar_location | str | 颜色条的位置。默认为 "right"。 | 'right' |
colorbar_label_name | str | 颜色条的标签名称。默认为空字符串。 | '' |
colorbar_label_rotation | int | 颜色条标签的旋转角度。默认为 0。 | 0 |
colorbar_decimals | int | 颜色条刻度的小数位数。默认为 1。 | 1 |
colorbar_fontsize | int | 颜色条标签的字体大小。默认为 8。 | 8 |
colorbar_nticks | int | 颜色条上的刻度数量。默认为 2。 | 2 |
colorbar_shrink | float | 颜色条的缩放比例。默认为 0.15。 | 0.15 |
colorbar_aspect | int | 颜色条的宽高比。默认为 8。 | 8 |
colorbar_draw_border | bool | 是否绘制颜色条边框。默认为 False。 | False |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 15。 | 15 |
title_y | float | 标题在 y 轴上的位置(范围通常为 0~1)。默认为 0.9。 | 0.9 |
rjx_colorbar | bool | 是否使用自定义颜色条。默认为 False。 | False |
rjx_colorbar_direction | str | 自定义颜色条方向,支持 "vertical" 或 "horizontal"。默认为 "vertical"。 | 'vertical' |
horizontal_center | bool | 水平颜色条是否居中。默认为 True。 | True |
rjx_colorbar_outline | bool | 自定义颜色条是否显示边框。默认为 False。 | False |
rjx_colorbar_label_name | str | 自定义颜色条标签名称。默认为空字符串。 | '' |
rjx_colorbar_tick_fontsize | int | 自定义颜色条刻度字体大小。默认为 10。 | 10 |
rjx_colorbar_label_fontsize | int | 自定义颜色条标签字体大小。默认为 10。 | 10 |
rjx_colorbar_tick_rotation | int | 自定义颜色条刻度标签旋转角度。默认为 0。 | 0 |
rjx_colorbar_tick_length | int | 自定义颜色条刻度长度。默认为 0。 | 0 |
rjx_colorbar_nticks | int | 自定义颜色条上的刻度数量。默认为 2。 | 2 |
Returns:
Type | Description |
---|---|
Figure | tuple[ndarray, ndarray] | Union[plt.Figure, tuple[np.ndarray, np.ndarray]]: 如果 |
Figure | tuple[ndarray, ndarray] | 否则返回左右脑数据数组的元组 |
Source code in src/plotfig/brain_surface.py
879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 |
|
plot_chimpanzee_hemi_brain_figure ¶
plot_chimpanzee_hemi_brain_figure(data, hemi='lh', surf='veryinflated', atlas='bna', vmin=None, vmax=None, cmap='Reds', colorbar=True, colorbar_location='right', colorbar_label_name='', colorbar_label_rotation=0, colorbar_decimals=1, colorbar_fontsize=8, colorbar_nticks=2, colorbar_shrink=0.15, colorbar_aspect=8, colorbar_draw_border=False, title_name='', title_fontsize=15, title_y=0.9)
绘制黑猩猩大脑单侧(左脑或右脑)表面图,支持 BNA 图谱。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, float] | 包含 ROI 名称及其对应值的字典。 | required |
hemi | str | 脑半球选择,支持 "lh"(左脑)或 "rh"(右脑)。默认为 "lh"。 | 'lh' |
surf | str | 大脑表面类型(如 "veryinflated", "midthickness")。默认为 "veryinflated"。 | 'veryinflated' |
atlas | str | 使用的图谱名称,目前仅支持 "bna"。默认为 "bna"。 | 'bna' |
vmin | Num | 颜色映射的最小值。可以是整数或浮点数。默认为 None。 | None |
vmax | Num | 颜色映射的最大值。可以是整数或浮点数。默认为 None。 | None |
cmap | str | 颜色映射方案。默认为 "Reds"。 | 'Reds' |
colorbar | bool | 是否显示颜色条。默认为 True。 | True |
colorbar_location | str | 颜色条的位置。默认为 "right"。 | 'right' |
colorbar_label_name | str | 颜色条的标签名称。默认为空字符串。 | '' |
colorbar_label_rotation | int | 颜色条标签的旋转角度。默认为 0。 | 0 |
colorbar_decimals | int | 颜色条刻度的小数位数。默认为 1。 | 1 |
colorbar_fontsize | int | 颜色条标签的字体大小。默认为 8。 | 8 |
colorbar_nticks | int | 颜色条上的刻度数量。默认为 2。 | 2 |
colorbar_shrink | float | 颜色条的缩放比例。默认为 0.15。 | 0.15 |
colorbar_aspect | int | 颜色条的宽高比。默认为 8。 | 8 |
colorbar_draw_border | bool | 是否绘制颜色条边框。默认为 False。 | False |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 15。 | 15 |
title_y | float | 标题在 y 轴上的位置(范围通常为 0~1)。默认为 0.9。 | 0.9 |
Returns:
Type | Description |
---|---|
Figure | plt.Figure: 返回一个 matplotlib 的 Figure 对象,表示生成的大脑表面图。 |
Source code in src/plotfig/brain_surface.py
1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 |
|
plot_human_brain_figure ¶
plot_human_brain_figure(data, surf='veryinflated', atlas='glasser', vmin=None, vmax=None, plot=True, cmap='Reds', as_outline=False, colorbar=True, colorbar_location='right', colorbar_label_name='', colorbar_label_rotation=0, colorbar_decimals=1, colorbar_fontsize=8, colorbar_nticks=2, colorbar_shrink=0.15, colorbar_aspect=8, colorbar_draw_border=False, title_name='', title_fontsize=15, title_y=0.9, rjx_colorbar=False, rjx_colorbar_direction='vertical', horizontal_center=True, rjx_colorbar_outline=False, rjx_colorbar_label_name='', rjx_colorbar_tick_fontsize=10, rjx_colorbar_label_fontsize=10, rjx_colorbar_tick_rotation=0, rjx_colorbar_tick_length=0, rjx_colorbar_nticks=2)
绘制人类大脑表面图,支持 Glasser 和 BNA 图谱。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, float] | 包含 ROI 名称及其对应值的字典。 | required |
surf | str | 大脑表面类型(如 "veryinflated", "inflated")。默认为 "veryinflated"。 | 'veryinflated' |
atlas | str | 使用的图谱名称,支持 "glasser" 或 "bna"。默认为 "glasser"。 | 'glasser' |
vmin | Num | 颜色映射的最小值。可以是整数或浮点数。默认为 None。 | None |
vmax | Num | 颜色映射的最大值。可以是整数或浮点数。默认为 None。 | None |
plot | bool | 是否直接绘制图形。默认为 True。 | True |
cmap | str | 颜色映射方案。默认为 "Reds"。 | 'Reds' |
as_outline | bool | 是否以轮廓形式显示颜色层。默认为 False。 | False |
colorbar | bool | 是否显示颜色条。默认为 True。 | True |
colorbar_location | str | 颜色条的位置。默认为 "right"。 | 'right' |
colorbar_label_name | str | 颜色条的标签名称。默认为空字符串。 | '' |
colorbar_label_rotation | int | 颜色条标签的旋转角度。默认为 0。 | 0 |
colorbar_decimals | int | 颜色条刻度的小数位数。默认为 1。 | 1 |
colorbar_fontsize | int | 颜色条标签的字体大小。默认为 8。 | 8 |
colorbar_nticks | int | 颜色条上的刻度数量。默认为 2。 | 2 |
colorbar_shrink | float | 颜色条的缩放比例。默认为 0.15。 | 0.15 |
colorbar_aspect | int | 颜色条的宽高比。默认为 8。 | 8 |
colorbar_draw_border | bool | 是否绘制颜色条边框。默认为 False。 | False |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 15。 | 15 |
title_y | float | 标题在 y 轴上的位置(范围通常为 0~1)。默认为 0.9。 | 0.9 |
rjx_colorbar | bool | 是否使用自定义颜色条。默认为 False。 | False |
rjx_colorbar_direction | str | 自定义颜色条方向,支持 "vertical" 或 "horizontal"。默认为 "vertical"。 | 'vertical' |
horizontal_center | bool | 水平颜色条是否居中。默认为 True。 | True |
rjx_colorbar_outline | bool | 自定义颜色条是否显示边框。默认为 False。 | False |
rjx_colorbar_label_name | str | 自定义颜色条标签名称。默认为空字符串。 | '' |
rjx_colorbar_tick_fontsize | int | 自定义颜色条刻度字体大小。默认为 10。 | 10 |
rjx_colorbar_label_fontsize | int | 自定义颜色条标签字体大小。默认为 10。 | 10 |
rjx_colorbar_tick_rotation | int | 自定义颜色条刻度标签旋转角度。默认为 0。 | 0 |
rjx_colorbar_tick_length | int | 自定义颜色条刻度长度。默认为 0。 | 0 |
rjx_colorbar_nticks | int | 自定义颜色条上的刻度数量。默认为 2。 | 2 |
Returns:
Type | Description |
---|---|
Figure | tuple[ndarray, ndarray] | Union[plt.Figure, tuple[np.ndarray, np.ndarray]]: 如果 |
Figure | tuple[ndarray, ndarray] | 否则返回左右脑数据数组的元组 |
Source code in src/plotfig/brain_surface.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
plot_human_hemi_brain_figure ¶
plot_human_hemi_brain_figure(data, hemi='lh', surf='veryinflated', atlas='glasser', vmin=None, vmax=None, cmap='Reds', colorbar=True, colorbar_location='right', colorbar_label_name='', colorbar_label_rotation=0, colorbar_decimals=1, colorbar_fontsize=8, colorbar_nticks=2, colorbar_shrink=0.15, colorbar_aspect=8, colorbar_draw_border=False, title_name='', title_fontsize=15, title_y=0.9)
绘制人类大脑单侧(左脑或右脑)表面图,支持 Glasser 和 BNA 图谱。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, float] | 包含 ROI 名称及其对应值的字典。 | required |
hemi | str | 脑半球选择,支持 "lh"(左脑)或 "rh"(右脑)。默认为 "lh"。 | 'lh' |
surf | str | 大脑表面类型(如 "veryinflated", "inflated")。默认为 "veryinflated"。 | 'veryinflated' |
atlas | str | 使用的图谱名称,支持 "glasser" 或 "bna"。默认为 "glasser"。 | 'glasser' |
vmin | Num | 颜色映射的最小值。可以是整数或浮点数。默认为 None。 | None |
vmax | Num | 颜色映射的最大值。可以是整数或浮点数。默认为 None。 | None |
cmap | str | 颜色映射方案。默认为 "Reds"。 | 'Reds' |
colorbar | bool | 是否显示颜色条。默认为 True。 | True |
colorbar_location | str | 颜色条的位置。默认为 "right"。 | 'right' |
colorbar_label_name | str | 颜色条的标签名称。默认为空字符串。 | '' |
colorbar_label_rotation | int | 颜色条标签的旋转角度。默认为 0。 | 0 |
colorbar_decimals | int | 颜色条刻度的小数位数。默认为 1。 | 1 |
colorbar_fontsize | int | 颜色条标签的字体大小。默认为 8。 | 8 |
colorbar_nticks | int | 颜色条上的刻度数量。默认为 2。 | 2 |
colorbar_shrink | float | 颜色条的缩放比例。默认为 0.15。 | 0.15 |
colorbar_aspect | int | 颜色条的宽高比。默认为 8。 | 8 |
colorbar_draw_border | bool | 是否绘制颜色条边框。默认为 False。 | False |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 15。 | 15 |
title_y | float | 标题在 y 轴上的位置(范围通常为 0~1)。默认为 0.9。 | 0.9 |
Returns:
Type | Description |
---|---|
Figure | None | plt.Figure: 返回一个 matplotlib 的 Figure 对象,表示生成的大脑表面图。 |
Source code in src/plotfig/brain_surface.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
|
plot_macaque_brain_figure ¶
plot_macaque_brain_figure(data, surf='veryinflated', atlas='charm5', vmin=None, vmax=None, plot=True, cmap='Reds', colorbar=True, colorbar_location='right', colorbar_label_name='', colorbar_label_rotation=0, colorbar_decimals=1, colorbar_fontsize=8, colorbar_nticks=2, colorbar_shrink=0.15, colorbar_aspect=8, colorbar_draw_border=False, title_name='', title_fontsize=15, title_y=0.9, rjx_colorbar=False, rjx_colorbar_direction='vertical', horizontal_center=True, rjx_colorbar_outline=False, rjx_colorbar_label_name='', rjx_colorbar_tick_fontsize=10, rjx_colorbar_label_fontsize=10, rjx_colorbar_tick_rotation=0, rjx_colorbar_tick_length=0, rjx_colorbar_nticks=2)
绘制猕猴大脑表面图,支持多种图谱(CHARM5、CHARM6、BNA、D99)。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, float] | 包含 ROI 名称及其对应值的字典。 | required |
surf | str | 大脑表面类型(如 "veryinflated", "inflated")。默认为 "veryinflated"。 | 'veryinflated' |
atlas | str | 使用的图谱名称,支持 "charm5", "charm6", "bna", "d99"。默认为 "charm5"。 | 'charm5' |
vmin | Num | 颜色映射的最小值。可以是整数或浮点数。默认为 None。 | None |
vmax | Num | 颜色映射的最大值。可以是整数或浮点数。默认为 None。 | None |
plot | bool | 是否直接绘制图形。默认为 True。 | True |
cmap | str | 颜色映射方案。默认为 "Reds"。 | 'Reds' |
colorbar | bool | 是否显示颜色条。默认为 True。 | True |
colorbar_location | str | 颜色条的位置。默认为 "right"。 | 'right' |
colorbar_label_name | str | 颜色条的标签名称。默认为空字符串。 | '' |
colorbar_label_rotation | int | 颜色条标签的旋转角度。默认为 0。 | 0 |
colorbar_decimals | int | 颜色条刻度的小数位数。默认为 1。 | 1 |
colorbar_fontsize | int | 颜色条标签的字体大小。默认为 8。 | 8 |
colorbar_nticks | int | 颜色条上的刻度数量。默认为 2。 | 2 |
colorbar_shrink | float | 颜色条的缩放比例。默认为 0.15。 | 0.15 |
colorbar_aspect | int | 颜色条的宽高比。默认为 8。 | 8 |
colorbar_draw_border | bool | 是否绘制颜色条边框。默认为 False。 | False |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 15。 | 15 |
title_y | float | 标题在 y 轴上的位置(范围通常为 0~1)。默认为 0.9。 | 0.9 |
rjx_colorbar | bool | 是否使用自定义颜色条。默认为 False。 | False |
rjx_colorbar_direction | str | 自定义颜色条方向,支持 "vertical" 或 "horizontal"。默认为 "vertical"。 | 'vertical' |
horizontal_center | bool | 水平颜色条是否居中。默认为 True。 | True |
rjx_colorbar_outline | bool | 自定义颜色条是否显示边框。默认为 False。 | False |
rjx_colorbar_label_name | str | 自定义颜色条标签名称。默认为空字符串。 | '' |
rjx_colorbar_tick_fontsize | int | 自定义颜色条刻度字体大小。默认为 10。 | 10 |
rjx_colorbar_label_fontsize | int | 自定义颜色条标签字体大小。默认为 10。 | 10 |
rjx_colorbar_tick_rotation | int | 自定义颜色条刻度标签旋转角度。默认为 0。 | 0 |
rjx_colorbar_tick_length | int | 自定义颜色条刻度长度。默认为 0。 | 0 |
rjx_colorbar_nticks | int | 自定义颜色条上的刻度数量。默认为 2。 | 2 |
Returns:
Type | Description |
---|---|
Figure | tuple[ndarray, ndarray] | Union[plt.Figure, tuple[np.ndarray, np.ndarray]]: 如果 |
Figure | tuple[ndarray, ndarray] | 否则返回左右脑数据数组的元组 |
Source code in src/plotfig/brain_surface.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 |
|
plot_macaque_hemi_brain_figure ¶
plot_macaque_hemi_brain_figure(data, hemi='lh', surf='veryinflated', atlas='charm5', vmin=None, vmax=None, cmap='Reds', colorbar=True, colorbar_location='right', colorbar_label_name='', colorbar_label_rotation=0, colorbar_decimals=1, colorbar_fontsize=8, colorbar_nticks=2, colorbar_shrink=0.15, colorbar_aspect=8, colorbar_draw_border=False, title_name='', title_fontsize=15, title_y=0.9)
绘制猕猴大脑单侧(左脑或右脑)表面图,支持多种图谱(CHARM5、CHARM6、BNA、D99)。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, float] | 包含 ROI 名称及其对应值的字典。 | required |
hemi | str | 脑半球选择,支持 "lh"(左脑)或 "rh"(右脑)。默认为 "lh"。 | 'lh' |
surf | str | 大脑表面类型(如 "veryinflated", "inflated")。默认为 "veryinflated"。 | 'veryinflated' |
atlas | str | 使用的图谱名称,支持 "charm5", "charm6", "bna", "d99"。默认为 "charm5"。 | 'charm5' |
vmin | Num | 颜色映射的最小值。可以是整数或浮点数。默认为 None。 | None |
vmax | Num | 颜色映射的最大值。可以是整数或浮点数。默认为 None。 | None |
cmap | str | 颜色映射方案。默认为 "Reds"。 | 'Reds' |
colorbar | bool | 是否显示颜色条。默认为 True。 | True |
colorbar_location | str | 颜色条的位置。默认为 "right"。 | 'right' |
colorbar_label_name | str | 颜色条的标签名称。默认为空字符串。 | '' |
colorbar_label_rotation | int | 颜色条标签的旋转角度。默认为 0。 | 0 |
colorbar_decimals | int | 颜色条刻度的小数位数。默认为 1。 | 1 |
colorbar_fontsize | int | 颜色条标签的字体大小。默认为 8。 | 8 |
colorbar_nticks | int | 颜色条上的刻度数量。默认为 2。 | 2 |
colorbar_shrink | float | 颜色条的缩放比例。默认为 0.15。 | 0.15 |
colorbar_aspect | int | 颜色条的宽高比。默认为 8。 | 8 |
colorbar_draw_border | bool | 是否绘制颜色条边框。默认为 False。 | False |
title_name | str | 图形标题。默认为空字符串。 | '' |
title_fontsize | int | 标题字体大小。默认为 15。 | 15 |
title_y | float | 标题在 y 轴上的位置(范围通常为 0~1)。默认为 0.9。 | 0.9 |
Returns:
Type | Description |
---|---|
Figure | plt.Figure: 返回一个 matplotlib 的 Figure 对象,表示生成的大脑表面图。 |
Source code in src/plotfig/brain_surface.py
695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 |
|
plotfig.brain_connection ¶
plot_brain_connection_figure ¶
plot_brain_connection_figure(connectome, lh_surfgii_file=None, rh_surfgii_file=None, niigz_file=None, nodes_name=None, nodes_size=5, nodes_color=None, output_file=None, scale_method='', line_width=10)
绘制大脑连接图,保存在指定的html文件中
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connectome | NDArray | 连接矩阵 | required |
lh_surfgii_file | str | Path | None | 左脑surf.gii文件. Defaults to None. | None |
rh_surfgii_file | str | Path | None | 右脑surf.gii文件. Defaults to None. | None |
niigz_file | str | Path | None | 图集nii文件. Defaults to None. | None |
nodes_name | List[str] | None | 节点名称. Defaults to None. | None |
nodes_size | Num | 节点大小. Defaults to 5. | 5 |
nodes_color | List[str] | None | 节点颜色. Defaults to None. | None |
output_file | str | Path | None | 保存的完整路径及文件名. Defaults to None. | None |
scale_method | str | 连接scale的形式. Defaults to "". | '' |
line_width | Num | 连接粗细. Defaults to 10. | 10 |
Raises:
Type | Description |
---|---|
ValueError | 参数参数取值不合法时抛出. |
Source code in src/plotfig/brain_connection.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|