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


Python FigureCanvasGTK3Agg.set_hexpand方法代码示例

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


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

示例1: LockinGui

# 需要导入模块: from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg [as 别名]
# 或者: from matplotlib.backends.backend_gtk3agg.FigureCanvasGTK3Agg import set_hexpand [as 别名]

#.........这里部分代码省略.........
        #Connections for scanning stack
        self.button_add_position.connect("clicked", self.on_add_position_clicked)
        self.button_spangrid.connect("clicked", self.on_spangrid_clicked)
        self.button_scan_start.connect("clicked", self.on_scan_start_clicked)
        self.button_scan_add.connect("clicked", self.on_scan_add)
        self.button_scan_remove.connect("clicked", self.on_scan_remove)
        self.button_scan_clear.connect("clicked", self.on_scan_clear)
        self.scan_xrenderer.connect("edited", self.on_scan_xedited)
        self.scan_yrenderer.connect("edited", self.on_scan_yedited)

        #Box for control of scanning
        self.ScanningBox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
        self.ScanningBox.add(Gtk.Separator())
        self.ScanningBox.add(self.button_add_position)
        self.ScanningBox.add(self.button_spangrid)
        self.ScanningBox.add(self.searchonoff_box)
        self.ScanningBox.add(self.lockinonoff_box)
        self.ScanningBox.add(Gtk.Separator())
        self.ScanningBox.add(Gtk.Label("Scanning Positions"))
        self.ScanningBox.add(self.scan_hbox)
        self.ScanningBox.add(self.scan_scroller)
        self.ScanningBox.add(Gtk.Separator())
        self.ScanningBox.add(self.button_scan_start)


        # MPL stuff
        self.figure = Figure()
        self.ax = self.figure.add_subplot(1, 1, 1)
        self.ax.grid(True)
        self.ax.set_xlabel("Wavelength [nm]")
        self.ax.set_ylabel("Intensity")
        self.ax.set_xlim([400, 900])
        self.canvas = FigureCanvas(self.figure)
        self.canvas.set_hexpand(True)
        self.canvas.set_vexpand(True)

        self.canvas.set_size_request(700, 700)

        self.stack = Gtk.Stack()
        self.stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
        self.stack.set_transition_duration(500)

        self.stack.add_titled(self.SpectrumBox, "spec", "Spectra")
        self.stack.add_titled(self.ScanningBox, "scan", "Scanning")

        self.stack_switcher = Gtk.StackSwitcher()
        self.stack_switcher.set_stack(self.stack)

        self.SideBox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
        self.SideBox.add(self.stack_switcher)
        self.ScanningBox.add(Gtk.Separator())
        self.SideBox.add(self.button_stop)
        self.SideBox.add(self.stack)
        self.SideBox.add(self.stage_hbox)
        self.SideBox.add(self.labels_hbox)

        self.grid.add(self.canvas)
        self.grid.attach_next_to(self.SideBox, self.canvas, Gtk.PositionType.RIGHT, 1, 1)
        self.grid.attach_next_to(self.progress, self.canvas, Gtk.PositionType.BOTTOM, 1, 1)
        self.grid.attach_next_to(self.status, self.SideBox, Gtk.PositionType.BOTTOM, 1, 1)

        self.window.show_all()

        self.spectrum = Spectrum(self.stage, self.settings, self.status, self.progress, self.enable_buttons,
                                 self.disable_buttons)  # logger class which coordinates the spectrometer and the stage
开发者ID:sdickreuter,项目名称:lock-in-spectrum,代码行数:69,代码来源:main.py


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