本文整理汇总了Python中surfer.Brain.add_text方法的典型用法代码示例。如果您正苦于以下问题:Python Brain.add_text方法的具体用法?Python Brain.add_text怎么用?Python Brain.add_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类surfer.Brain
的用法示例。
在下文中一共展示了Brain.add_text方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_text
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_text [as 别名]
def test_text():
"""Test plotting of text
"""
mlab.options.backend = 'test'
brain = Brain(*std_args)
brain.add_text(0.1, 0.1, 'Hello', 'blah')
brain.close()
示例2: Brain
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_text [as 别名]
# Surface used to project 'white', 'inflated' or other
surf = "inflated"
brain = Brain("fsaverage", hemi, surf, views=['lat'],
config_opts=dict(background="white", colorbar="False"))
for r in sorted(rois):
# Name of ROI
name_roi = os.path.splitext(os.path.basename(r))[0]
#save_png= os.path.join(datadir, "{h}_{name_roi}".format(h=hemi, name_roi=name_roi))
# Manage the color
color = [val/255. for val in color_list[cpt_color]]
# Add a title
pos_y += 0.05
text = brain.add_text(0.1, pos_y, color=tuple(color),
text=name_roi, name=name_roi)
text = brain.texts[name_roi]
text.width = 0.2
# Projection part
# If reg_file if needed:
# surf_data = io.project_volume_data(r, "lh", reg_file)
# Projection parameters, see the docstring for more information
projmeth = "frac" # frac' method, projection on a fraction of thickness
projsum = "max" # the max value is projected
projarg = [0, 1, 0.1] # from 0 to 1 thickness fract every 0.1 step
smooth_fwhm = 0 # no smoothing
surf_data = io.project_volume_data(r, hemi,
projmeth=projmeth,
projsum=projsum,
projarg=projarg,
示例3: test_text
# 需要导入模块: from surfer import Brain [as 别名]
# 或者: from surfer.Brain import add_text [as 别名]
def test_text():
"""Test plotting of text."""
_set_backend('test')
brain = Brain(*std_args)
brain.add_text(0.1, 0.1, 'Hello', 'blah')
brain.close()