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