玛雅维剪切文字

时间:2014-04-24 16:47:09

标签: python string text mayavi

有没有办法避免mayavi剪切文本中的某些字符? 我试图做

t = mlab.text(0.8, 0.9, '5', width=0.18, line_width = 1., color = (0, 0, 0))

但我得到类似`

的东西

Cut text

如果我使用诸如' 25'之类的文字,它看起来很好。我也尝试使用' 5' .rjust(2),但没有成功。

- 编辑 - 其余代码是这个

from mayavi import mlab
import mayavi

# Figure specs
f = mlab.figure(bgcolor=(1, 1, 1), fgcolor=(0, 0, 0), size=(500, 500))

# Read a data file.
data = mlab.pipeline.open('image.vtu')

# Extract vec comp and plot
vecomp = mlab.pipeline.extract_vector_components(data)
vecomp.component = 'z-component'
surfc = mlab.pipeline.surface(vecomp, vmax=1, vmin=-1, colormap='hot')
mlab.view(elevation = 0)
t = mlab.text(0.8, 0.9, '00',  width=0.16, line_width = 1., color = (0, 0, 0))
# Save
f.scene.save('image_mayavi.png')    
mlab.show()

0 个答案:

没有答案