本文整理汇总了Python中chaco.api.HPlotContainer.padding_bottom方法的典型用法代码示例。如果您正苦于以下问题:Python HPlotContainer.padding_bottom方法的具体用法?Python HPlotContainer.padding_bottom怎么用?Python HPlotContainer.padding_bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chaco.api.HPlotContainer
的用法示例。
在下文中一共展示了HPlotContainer.padding_bottom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_plot_cmap
# 需要导入模块: from chaco.api import HPlotContainer [as 别名]
# 或者: from chaco.api.HPlotContainer import padding_bottom [as 别名]
def _get_plot_cmap(self):
if self.data is None or len(self.data.shape) == 1:
return
numpoints = self.data.shape[1]
if self.scale_type == 'Time':
index_x = self._create_dates(numpoints, start=self.first_day)
else:
index_x = np.arange(numpoints)
x_bounds = (index_x[0], index_x[-1], len(index_x))
y_bounds = (1, self.data.shape[0], self.data.shape[0])
# Create a plot data obect and give it this data
pd = ArrayPlotData()
pd.set_data("imagedata", self.data)
plot = Plot(pd)
plot.img_plot("imagedata",
name="corr_plot",
origin="top left",
xbounds=x_bounds[:2],
ybounds=y_bounds[:2],
colormap=jet,
padding_left=25)
corr_plot = plot.plots['corr_plot'][0]
if self.scale_type == 'Time':
# Just the last axis shows tick_labels
bottom_axis = PlotAxis(corr_plot, orientation="bottom", title=self.x_lbl,
tick_generator=ScalesTickGenerator(scale=CalendarScaleSystem()))
else:
bottom_axis = PlotAxis(orientation='bottom',
title=self.x_lbl,
title_font="modern 12",
tick_visible=True,
small_axis_style=True,
axis_line_visible=False,
component=corr_plot)
corr_plot.overlays.append(bottom_axis)
corr_plot.tools.append(PanTool(corr_plot,
constrain=True,
constrain_direction="x",
constrain_key="shift"))
corr_plot.overlays.append(ZoomTool(corr_plot,
drag_button="right",
always_on=True,
tool_mode="range",
axis="index",
max_zoom_out_factor=10.0,
))
# Create the colorbar, handing in the appropriate range and colormap
colorbar = ColorBar(index_mapper=LinearMapper(range=corr_plot.color_mapper.range),
color_mapper=corr_plot.color_mapper,
plot=corr_plot,
orientation='v',
resizable='v',
width=30,
padding_top=corr_plot.padding_top,
padding_bottom=corr_plot.padding_bottom,
padding_left=50,
padding_right=5)
#colorbar.plot = corr_plot
#colorbar.padding_top = corr_plot.padding_top
#colorbar.padding_bottom = corr_plot.padding_bottom
# Add pan and zoom tools to the colorbar
pan_tool = PanTool(colorbar, constrain_direction="y", constrain=True)
colorbar.tools.append(pan_tool)
zoom_overlay = ZoomTool(colorbar, axis="index", tool_mode="range",
always_on=False, drag_button=None)
colorbar.overlays.append(zoom_overlay)
# Create a container to position the plot and the colorbar side-by-side
container = HPlotContainer(corr_plot, colorbar, use_backbuffer=True, bgcolor="transparent",
spacing=9, padding=30)
container.overlays.append(PlotLabel(self.p_title,
component=container,
overlay_position="outside top",
font="modern 16"))
container.overlays.append(PlotLabel(self.y_lbl,
component=container,
angle=90.0,
overlay_position="outside left",
font="modern 12"))
container.padding_bottom = 50
return container