当前位置: 首页>>代码示例>>Python>>正文


Python VPlotContainer.padding_bottom方法代码示例

本文整理汇总了Python中chaco.api.VPlotContainer.padding_bottom方法的典型用法代码示例。如果您正苦于以下问题:Python VPlotContainer.padding_bottom方法的具体用法?Python VPlotContainer.padding_bottom怎么用?Python VPlotContainer.padding_bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chaco.api.VPlotContainer的用法示例。


在下文中一共展示了VPlotContainer.padding_bottom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_plot_vertical

# 需要导入模块: from chaco.api import VPlotContainer [as 别名]
# 或者: from chaco.api.VPlotContainer import padding_bottom [as 别名]

#.........这里部分代码省略.........
                                edge_color="blue",
                                face_color="paleturquoise",
                                bgcolor="white",
                                border_visible=True,
                                padding_left=25)

            ###### Y axis #####################################################

            if self.y_lbl_type == 'Corr':
                vtitle = ("%d" % (m + 1)) + u"\u00B0" + " t_win"
            elif self.y_lbl_type == 'Single':
                vtitle = "" # One label for all the axis
            elif self.y_lbl_type == 'Custom' and \
                 len(self.y_labels) == self.data.shape[0] and \
                 self.y_labels[m] is not None:
                # a new value in the list defaults to None so raise an error before
                # the operator ends inputing it. 
                vtitle = self.y_labels[m]
            else:
                vtitle = ""

            left = PlotAxis(orientation='left',
                            title=vtitle,
                            title_font="modern 12",
                            #title_spacing=0,
                            tick_label_font="modern 8",
                            tick_visible=True,
                            small_axis_style=True,
                            axis_line_visible=False,
                            ensure_labels_bounded=True,
                            #tick_label_color="transparent",
                            mapper=corr_mapper,
                            component=corr_plot)

            corr_plot.overlays.append(left)

            ###### X axis #####################################################

            if m != (self.data.shape[0] - 1):
                if self.scale_type == 'Time':
                    # Set the plot's bottom axis to use the Scales ticking system
                    bottom_axis = PlotAxis(corr_plot, orientation="bottom",
                                           tick_label_color="transparent", # mapper=xmapper,
                                           tick_generator=ScalesTickGenerator(scale=CalendarScaleSystem()))
                else:
                    bottom_axis = PlotAxis(orientation='bottom',
                                           title="",
                                           tick_label_color="transparent",
                                           tick_visible=True,
                                           small_axis_style=True,
                                           axis_line_visible=False,
                                           component=corr_plot)
            else:
                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)
            _, vgrid = add_default_grids(corr_plot)
            vgrid.tick_generator = bottom_axis.tick_generator

            corr_plot.tools.append(PanTool(corr_plot, constrain=True,
                                            constrain_direction="x"))
            corr_plot.overlays.append(ZoomTool(corr_plot, drag_button="right",
                                                  always_on=True,
                                                  tool_mode="box",
                                                  #axis="index",
                                                  max_zoom_out_factor=10.0,
                                                 ))

            container.add(corr_plot)

        for component in container.components:
            component.y_mapper.range.set_bounds(self.y_low, self.y_high)

        container.overlays.append(PlotLabel(self.p_title,
                                    component=container,
                                    overlay_position="outside top",
                                    font="modern 16"))

        if self.y_lbl_type == 'Single':
            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
开发者ID:ftilmann,项目名称:miic,代码行数:104,代码来源:plot_mod.py


注:本文中的chaco.api.VPlotContainer.padding_bottom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。