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


Python HPlotContainer.spacing方法代码示例

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


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

示例1: __init__

# 需要导入模块: from enthought.chaco.api import HPlotContainer [as 别名]
# 或者: from enthought.chaco.api.HPlotContainer import spacing [as 别名]
    def __init__(self):
        # Create the data and the PlotData object
        x = linspace(-14, 14, 100)
        y = sin(x) * x**3
        plotdata = ArrayPlotData(x = x, y = y)
        # Create the scatter plot
        scatter = Plot(plotdata)
        scatter.plot(("x", "y"), type="scatter", color="blue")
        # Create the line plot
        line = Plot(plotdata)
        line.plot(("x", "y"), type="line", color="blue")
        # Create a horizontal container and put the two plots inside it
        container = HPlotContainer(scatter, line)
        container.spacing = 0
        scatter.padding_right = 0
        line.padding_left = 0
        line.y_axis.orientation = "right"

        self.plot = container
开发者ID:brycehendrix,项目名称:chaco,代码行数:21,代码来源:container_nospace.py

示例2: init

# 需要导入模块: from enthought.chaco.api import HPlotContainer [as 别名]
# 或者: from enthought.chaco.api.HPlotContainer import spacing [as 别名]
    def init(self,data):
        self.raw = data
        self.data_selected = data
        index = range(self.raw.length)
        self.x1 = 0
        self.x2 = self.raw.length

        self.epsilon = self.data_selected.epsilon
        self.word_size = self.data_selected.word_size
        self.alphabet_size = self.data_selected.alphabet_size

        self.id1 = self.data_selected.id1
        self.id2 = self.data_selected.id2
        self.id3 = self.data_selected.id3

        self.window_min = self.data_selected.window_min
        self.window_max = self.data_selected.window_max
        self.window_step = self.data_selected.window_step

        self.dist_max = self.data_selected.dist_max

        overviewkwargs = {}
        for (dim,i) in zip(self.raw.data_transposed, range(len(self.plot_names))):
            overviewkwargs[self.plot_names[i]] = dim

        overviewdata = ArrayPlotData(index=index, **overviewkwargs)
        overview = Plot(overviewdata)

        axiscontainer = VPlotContainer()
        axiscontainer.spacing = 0
        aps = []
        paastep = self.selected_length / (len(self.data_selected.data_paaed[0]))
        paaindex = range(paastep/2,self.selected_length, paastep)

        for (dim,i) in zip(self.raw.data_transposed, range(len(self.plot_names))):
            overview.plot(("index",self.plot_names[i]),
                          type="line",
                          color=self.plot_colors[i])

            ap = Plot(ArrayPlotData(index = index,
                                    paaindex = paaindex,
                                    paa = self.data_selected.data_paaed[i],
                                    **{self.plot_names[i]:self.data_selected.data_transposed[i]}))

            ap.plot(("index",self.plot_names[i]), type="line", color=self.plot_colors[i])
            ap.plot(("paaindex","paa"), type="scatter", color=self.plot_colors[i])
            #ap.title = a["name"]
            ap.padding_top = 1
            ap.padding_bottom = 0
            ap.y_axis.orientation = "right"
            axiscontainer.add(ap)
            aps.append(ap)
            ap.components[1].visible = False

        self.aps = aps

        rs = RangeSelection(overview.components[0], left_button_selects= True)
        self.selector = rs
        overview.components[0].tools.append(rs)
        overview.components[0].overlays.append(RangeSelectionOverlay(component=overview.components[0]))

        lrcontainer = HPlotContainer(overview,axiscontainer)

        lrcontainer.spacing = 0
        self.plot = lrcontainer
开发者ID:yggi,项目名称:smear,代码行数:67,代码来源:plotter.py


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