當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。