本文整理汇总了Python中chaco.api.VPlotContainer.bgcolor方法的典型用法代码示例。如果您正苦于以下问题:Python VPlotContainer.bgcolor方法的具体用法?Python VPlotContainer.bgcolor怎么用?Python VPlotContainer.bgcolor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chaco.api.VPlotContainer
的用法示例。
在下文中一共展示了VPlotContainer.bgcolor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _brain_default
# 需要导入模块: from chaco.api import VPlotContainer [as 别名]
# 或者: from chaco.api.VPlotContainer import bgcolor [as 别名]
def _brain_default(self):
plot = Plot(self.brain_data, padding=0)
plot.width = self.brain_voxels.shape[1]
plot.height = self.brain_voxels.shape[0]
plot.aspect_ratio = 1.
plot.index_axis.visible = False
plot.value_axis.visible = False
renderer = plot.img_plot("axial", colormap=gray)[0]
plot.color_mapper.range = DataRange1D(low=0., high=1.0)
plot.bgcolor = 'pink'
# Brain tools
plot.tools.append(PanTool(plot, drag_button="right"))
plot.tools.append(ZoomTool(plot))
imgtool = ImageInspectorTool(renderer)
renderer.tools.append(imgtool)
overlay = ImageInspectorOverlay(component=renderer, image_inspector=imgtool,
bgcolor="white", border_visible=True)
renderer.overlays.append(overlay)
# Brain track cursor
self.cursor = CursorTool2D(renderer, drag_button='left', color='red', line_width=2.0)
self.cursor.on_trait_change(self.update_stackedhist, 'current_index')
self.cursor.current_position = (0., 0.)
renderer.overlays.append(self.cursor)
# Brain colorbar
colormap = plot.color_mapper
colorbar = ColorBar(index_mapper=LinearMapper(range=colormap.range),
color_mapper=colormap,
plot=plot,
orientation='v',
resizable='v',
width=20,
padding=(30, 0, 0, 0))
colorbar.padding_top = plot.padding_top
colorbar.padding_bottom = plot.padding_bottom
# Brain_map
plot2 = Plot(self.brain_data, padding=0)
plot2.width = self.brain_voxels.shape[1]
plot2.height = self.brain_voxels.shape[0]
plot2.aspect_ratio = 1.
plot2.index_axis.visible = False
plot2.value_axis.visible = False
renderer2 = plot2.img_plot("map_axial", colormap=gray)[0]
plot2.color_mapper.range = DataRange1D(low=0., high=1.0)
plot2.bgcolor = 'pink'
plot2.range2d = plot.range2d
# Brain_map tools
plot2.tools.append(PanTool(plot2, drag_button="right"))
plot2.tools.append(ZoomTool(plot2))
imgtool2 = ImageInspectorTool(renderer2)
renderer2.tools.append(imgtool2)
overlay2 = ImageInspectorOverlay(component=renderer2, image_inspector=imgtool2,
bgcolor="white", border_visible=True)
renderer2.overlays.append(overlay2)
# Brain_map track cursor
self.cursor2 = CursorTool2D(renderer2, drag_button='left', color='red', line_width=2.0)
#self.cursor2.on_trait_change(self.update_stackedhist, 'current_index')
self.cursor2.on_trait_change(self.cursor2_changed, 'current_index')
self.cursor2.current_position = (0., 0.)
renderer2.overlays.append(self.cursor2)
# Brain_map colorbar
colormap2 = plot2.color_mapper
colorbar2 = ColorBar(index_mapper=LinearMapper(range=colormap2.range),
color_mapper=colormap2,
plot=plot2,
orientation='v',
resizable='v',
width=20,
padding=(30, 0, 0, 0))
colorbar2.padding_top = plot2.padding_top
colorbar2.padding_bottom = plot2.padding_bottom
# Create a container to position the plot and the colorbar side-by-side
container = HPlotContainer(use_backbuffer=True, padding=(0, 0, 10, 10))
container.add(plot)
container.add(colorbar)
container.bgcolor = "lightgray"
container2 = HPlotContainer(use_backbuffer=True, padding=(0, 0, 10, 10))
container2.add(plot2)
container2.add(colorbar2)
container2.bgcolor = "lightgray"
Vcontainer = VPlotContainer(use_backbuffer=True)
Vcontainer.add(container2)
Vcontainer.add(container)
Vcontainer.bgcolor = "lightgray"
return Vcontainer