[英]How to change a mayavi scene background color?
這可能是一個非常簡單的問題,但我無法在任何地方找到答案! 我在 PyQt5 中嵌入了一個mayavi
場景,我想更改背景顏色。 (可從 GUI 中場景的更改屬性按鈕獲得)
我的代碼如下所示:
class Visualizer(HasTraits):
scene = Instance(MlabSceneModel, ())
view = View(Item('scene', height=400, show_label=False,
editor=SceneEditor(scene_class=MayaviScene)),
resizable=True)
def __init__(self):
super(Visualizer, self).__init__()
self.x, self.y, self.z = ...
@on_trait_change('scene.activated')
def update_event(self):
self.plot = self.scene.mlab.points3d(self.x, self.y, self.z, color=(0.5, 1, 1))
任何幫助,將不勝感激。
終於找到答案:
self.scene.background = (1, 1, 1) # for white
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.