當前位置: 首頁>>代碼示例>>Python>>正文


Python Plot.destroy方法代碼示例

本文整理匯總了Python中plot.Plot.destroy方法的典型用法代碼示例。如果您正苦於以下問題:Python Plot.destroy方法的具體用法?Python Plot.destroy怎麽用?Python Plot.destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在plot.Plot的用法示例。


在下文中一共展示了Plot.destroy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Datamonitor

# 需要導入模塊: from plot import Plot [as 別名]
# 或者: from plot.Plot import destroy [as 別名]
class Datamonitor(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.parent = parent
        # create plots for drawing on
        self.accel_plot = Plot(self, ylabel="Acceleration (g)", numy=3, xrng=10, name="ACCEL")
        self.gyro_plot = Plot(self, ylabel="Angular Velocity (degrees/s)", numy=3, xrng=10, name="GYRO")
        self.mag_plot = Plot(self, ylabel="Field Strength", numy=3, xrng=10, name="MAG")
        self.plots = (self.accel_plot, self.gyro_plot, self.mag_plot)
        self.attitude_plot = Tiltmeter(self)
        self.x = 0
        self.y = 0
        self.width = 0
        self.height = 0
        self.plotnext = 0

    def place(self, x, y, width, height):
        # fit all plots in window
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        figureheight = height/3-4/3*bw
        figurewidth = width-2*bw 
        self.accel_plot.place(x=bw, y=bw, width=figurewidth, height=figureheight)
        self.gyro_plot.place(x=bw, y=figureheight+2*bw, width=figurewidth, height=figureheight)
        self.mag_plot.place(x=bw, y=2*figureheight+3*bw, width=figurewidth-bw-figureheight, height=figureheight)
        self.attitude_plot.place(x=width-figureheight-bw, y=2*figureheight+3*bw, width=figureheight, height=figureheight) 

    def show(self):
        self.accel_plot.show(True)
        self.gyro_plot.show(True)
        self.mag_plot.show(True)
        self.attitude_plot.show(True)
        self.update()

    def hide(self):
        self.accel_plot.show(False)
        self.gyro_plot.show(False)
        self.mag_plot.show(False)
        self.attitude_plot.show(False)

    def update(self):
        self.place(self.x, self.y, self.width, self.height)

    def refresh(self):
        self.plots[self.plotnext].draw()
        self.plotnext = (self.plotnext + 1) % len(self.plots)

    def reset(self):
        for plot in self.plots:
            plot.reset()
        self.attitude_plot.reset()

    def destroy(self):
        self.accel_plot.destroy()
        self.gyro_plot.destroy()
        self.mag_plot.destroy()
開發者ID:QUASR,項目名稱:QRET-GUI,代碼行數:60,代碼來源:datamonitor.py


注:本文中的plot.Plot.destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。