• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python backend_gtk3cairo.FigureCanvasGTK3Cairo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中matplotlib.backends.backend_gtk3cairo.FigureCanvasGTK3Cairo的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasGTK3Cairo类的具体用法?Python FigureCanvasGTK3Cairo怎么用?Python FigureCanvasGTK3Cairo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: draw

	def draw(self):
		x = [5,8,10]
		y = [12,16,6]
		
		x2 = [6,9,11]
		y2 = [6,15,7]
		
		fig, ax = plt.subplots()		
		canvas = FigureCanvas(fig)
		canvas.set_size_request(600,600)
		canvas.set_parent(self._scrolledwindow)
		#self._scrolledwindow.add_with_viewport(canvas)
	
		ax.bar(x, y, align='center')
		
		ax.bar(x2, y2, color='y', align='center')
		
		ax.plot()
		
		plt.title('Epic Info')
		plt.ylabel('Y axis')
		plt.xlabel('X axis')

		#print(dir(fig.canvas))
		#plt.draw()
		plt.show(block=False)
开发者ID:neo5g,项目名称:gsrp5,代码行数:26,代码来源:views.py


示例2: __init__

    def __init__(self, application):
        """ Create a summary page containing various statistics such as the number of logs in the logbook, the logbook's modification date, etc.

        :arg application: The PyQSO application containing the main Gtk window, etc.
        """

        self.application = application
        self.logbook = self.application.logbook
        self.builder = self.application.builder
        glade_file_path = join(realpath(dirname(__file__)), "res", "pyqso.glade")
        self.builder.add_objects_from_file(glade_file_path, ("summary_page",))
        self.summary_page = self.builder.get_object("summary_page")

        self.items = {}

        # Database name in large font at the top of the summary page
        self.builder.get_object("database_name").set_markup("<span size=\"x-large\">%s</span>" % basename(self.logbook.path))
        self.items["LOG_COUNT"] = self.builder.get_object("log_count")
        self.items["QSO_COUNT"] = self.builder.get_object("qso_count")
        self.items["DATE_MODIFIED"] = self.builder.get_object("date_modified")

        # Yearly statistics
        config = configparser.ConfigParser()
        have_config = (config.read(expanduser('~/.config/pyqso/preferences.ini')) != [])
        (section, option) = ("general", "show_yearly_statistics")
        if(have_config and config.has_option(section, option)):
            if(config.getboolean("general", "show_yearly_statistics") and have_matplotlib):
                hbox = Gtk.HBox()
                label = Gtk.Label(label="Display statistics for year: ", halign=Gtk.Align.START)
                hbox.pack_start(label, False, False, 6)
                year_select = Gtk.ComboBoxText()
                min_year, max_year = self.get_year_bounds()
                if min_year and max_year:
                    for year in range(max_year, min_year-1, -1):
                        year_select.append_text(str(year))
                year_select.append_text("")
                year_select.connect("changed", self.on_year_changed)
                hbox.pack_start(year_select, False, False, 6)
                self.summary_page.pack_start(hbox, False, False, 4)

                self.items["YEARLY_STATISTICS"] = Figure()
                canvas = FigureCanvas(self.items["YEARLY_STATISTICS"])
                canvas.set_size_request(800, 175)
                canvas.show()
                self.summary_page.pack_start(canvas, True, True, 0)

        # Summary tab label and icon.
        tab = Gtk.HBox(homogeneous=False, spacing=0)
        label = Gtk.Label(label="Summary  ")
        icon = Gtk.Image.new_from_icon_name(Gtk.STOCK_INDEX, Gtk.IconSize.MENU)
        tab.pack_start(label, False, False, 0)
        tab.pack_start(icon, False, False, 0)
        tab.show_all()

        self.logbook.notebook.insert_page(self.summary_page, tab, 0)  # Append as a new tab
        self.logbook.notebook.show_all()

        return
开发者ID:ctjacobs,项目名称:pyqso,代码行数:58,代码来源:summary.py


示例3: open_detatiled_station_window

	def open_detatiled_station_window(self, station_name, x=0, y=0):
		latest_data = []
		station_url = ""

		#Find the correct link for the requested station
		for link in self.every_station_link:
			if link[0] == station_name:
				#Perform detailed scrape
				latest_data = detailed_station_scrape(link[1], station_name)
				station_url = link[1]

		csv_url = get_csv_link(station_url, station_name)
		
		# Build new window based on Glade file.
		builder = Gtk.Builder()
		builder.add_from_file("Station Window.glade")
		builder.connect_signals(Handler())

		builder.get_object("label1").set_text(station_name)
		builder.get_object("label7").set_text(latest_data[0])
		builder.get_object("label8").set_text(latest_data[1])
		builder.get_object("label9").set_text(latest_data[2])
		builder.get_object("label10").set_text(latest_data[3])
		builder.get_object("label11").set_text(latest_data[4])
		builder.get_object("label18").set_text(latest_data[5])
		builder.get_object("label19").set_text(latest_data[6])
		builder.get_object("label20").set_text(latest_data[7])
		builder.get_object("label21").set_text(latest_data[8])
		builder.get_object("label22").set_text(latest_data[9])
		builder.get_object("label26").set_text(latest_data[10])
		builder.get_object("label27").set_text(latest_data[11])
		builder.get_object("label28").set_text(latest_data[12])

		display_station_win = builder.get_object("window1")
		display_station_win.set_title(station_name)
		display_station_win.move(x,y)

		refresh_butt = builder.get_object("button1")
		refresh_butt.connect("clicked", self.on_refresh_clicked)

		display_station_win.connect("delete-event", self.close_window_and_remove_reference)
		self.list_of_current_windows.append(display_station_win)#Dogfood # Stores current window in array so they can be iterated through when saving

		# Graph
		if csv_url != "no data":
			temperature_data = csv_scrap(csv_url)
			fig = temperature_graph(temperature_data)
			scroll_win = builder.get_object("scrolledwindow1")
			canvas = FigureCanvas(fig)
			canvas.set_size_request(400,400)
			scroll_win.add_with_viewport(canvas)

		display_station_win.show_all()
开发者ID:paulbutera,项目名称:SEPT-BogVirus,代码行数:53,代码来源:scrapeWeather.py


示例4: PlotWidget

class PlotWidget(Widgets.WidgetBase):

    def __init__(self, plot, width=500, height=500):
        super(PlotWidget, self).__init__()

        self.widget = FigureCanvas(plot.get_figure())
        self.plot = plot

        self.widget.set_size_request(width, height)
        self.widget.show_all()

    def configure_window(self, wd, ht):
        self.logger.debug("canvas resized to %dx%d" % (wd, ht))
        fig = self.plot.get_figure()
        fig.set_size_inches(float(wd) / fig.dpi, float(ht) / fig.dpi)
开发者ID:naojsoft,项目名称:ginga,代码行数:15,代码来源:Plot.py


示例5: __init__

    def __init__(self, workdir, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.workdir = workdir

        # main containers
        scr_win = Gtk.ScrolledWindow(visible=True)
        pad_box = Gtk.Box(visible=True)
        pad_box.pack_start(scr_win, True, True, 20)

        main_box = Gtk.Box(visible=True, orientation=Gtk.Orientation.VERTICAL)
        scr_win.add_with_viewport(main_box)

        # content
        lbl_head = '<span font="36.0"><b>Project Stats</b></span>'
        heading = Gtk.Label(label=lbl_head, expand=True, visible=True)
        heading.set_use_markup(True)
        main_box.pack_start(heading, False, False, 0)
        line = Gtk.Separator(visible=True)
        main_box.pack_start(line, False, False, 0)

        self.fig = Figure(facecolor='none')
        self.ax = self.fig.add_subplot(111, axisbg='#ffffff')
        self.canvas = FigCanvas(self.fig)
        self.canvas.set_size_request(800, 600)
        self.canvas.draw()
        self.canvas.show()
        main_box.pack_start(self.canvas, True, True, 0)

        self.add(pad_box)
        self.titlebar = Ide.WorkbenchHeaderBar(visible=True)

         # Gather stats
        thread = threading.Thread(target=self.gather_stats)
        thread.daemon = True
        thread.start()
开发者ID:tobias47n9e,项目名称:builder-project-stats,代码行数:35,代码来源:__init__.py


示例6: __init__

	def __init__(self, application, size_request=None):
		"""
		:param tuple size_request: The size to set for the canvas.
		"""
		self.application = application
		self.config = application.config
		"""A reference to the King Phisher client configuration."""
		self.figure, _ = pyplot.subplots()
		self.axes = self.figure.get_axes()
		self.canvas = FigureCanvas(self.figure)
		self.manager = None
		if size_request:
			self.canvas.set_size_request(*size_request)
		self.canvas.mpl_connect('button_press_event', self.mpl_signal_canvas_button_pressed)
		self.canvas.show()
		self.navigation_toolbar = NavigationToolbar(self.canvas, self.application.get_active_window())
		self.popup_menu = Gtk.Menu.new()

		menu_item = Gtk.MenuItem.new_with_label('Export')
		menu_item.connect('activate', self.signal_activate_popup_menu_export)
		self.popup_menu.append(menu_item)

		menu_item = Gtk.MenuItem.new_with_label('Refresh')
		menu_item.connect('activate', lambda action: self.refresh())
		self.popup_menu.append(menu_item)

		menu_item = Gtk.CheckMenuItem.new_with_label('Show Toolbar')
		menu_item.connect('toggled', self.signal_toggled_popup_menu_show_toolbar)
		self._menu_item_show_toolbar = menu_item
		self.popup_menu.append(menu_item)
		self.popup_menu.show_all()
		self.navigation_toolbar.hide()
开发者ID:coldfusion39,项目名称:king-phisher,代码行数:32,代码来源:graphs.py


示例7: __init__

	def __init__(self, application, size_request=None, style_context=None):
		"""
		:param tuple size_request: The size to set for the canvas.
		"""
		self.application = application
		self.style_context = style_context
		self.config = application.config
		"""A reference to the King Phisher client configuration."""
		self.figure, _ = pyplot.subplots()
		self.figure.set_facecolor(self.get_color('bg', ColorHexCode.WHITE))
		self.axes = self.figure.get_axes()
		self.canvas = FigureCanvas(self.figure)
		self.manager = None
		self.minimum_size = (380, 200)
		"""An absolute minimum size for the canvas."""
		if size_request is not None:
			self.resize(*size_request)
		self.canvas.mpl_connect('button_press_event', self.mpl_signal_canvas_button_pressed)
		self.canvas.show()
		self.navigation_toolbar = NavigationToolbar(self.canvas, self.application.get_active_window())

		self.popup_menu = managers.MenuManager()
		self.popup_menu.append('Export', self.signal_activate_popup_menu_export)
		self.popup_menu.append('Refresh', self.signal_activate_popup_refresh)

		menu_item = Gtk.CheckMenuItem.new_with_label('Show Toolbar')
		menu_item.connect('toggled', self.signal_toggled_popup_menu_show_toolbar)
		self._menu_item_show_toolbar = menu_item
		self.popup_menu.append_item(menu_item)

		self.navigation_toolbar.hide()
		self._legend = None
开发者ID:fo0nikens,项目名称:king-phisher,代码行数:32,代码来源:graphs.py


示例8: create_ui

    def create_ui(self):
        self.fig = Figure(figsize=(8, 8), dpi=100)
        self.axes = []

        sw = Gtk.ScrolledWindow()

        plot_box = Gtk.VBox()
        sw.add_with_viewport(plot_box)

        canvas = FigureCanvas(self.fig)
        canvas.set_size_request(500, 600)
        plot_box.pack_start(canvas, True, True, 0)

        toolbar = NavigationToolbar2(canvas, sw)
        self.widget.pack_start(toolbar, False, False, 0)
        self.widget.add(sw)
开发者ID:cfobel,项目名称:webcam-recorder,代码行数:16,代码来源:view.py


示例9: __init__

    def __init__(self, plot, width=500, height=500):
        super(PlotWidget, self).__init__()

        self.widget = FigureCanvas(plot.get_figure())
        self.plot = plot

        self.widget.set_size_request(width, height)
        self.widget.show_all()
开发者ID:naojsoft,项目名称:ginga,代码行数:8,代码来源:Plot.py


示例10: onGoPressed

    def onGoPressed(self, button):
        symbol = self.symbol.get_text()
        asset = pd.io.data.DataReader(symbol, 'yahoo')

        figure = Figure(figsize=(5, 4), dpi=100, frameon=False)
        subplot = figure.add_subplot(1, 1, 1)
        subplot.plot(asset.index, asset['Adj Close'])
        subplot.autoscale_view(True, True, True)

        canvas = FigureCanvas(figure)
        canvas.set_size_request(500, 250)

        sw = self.app.builder.get_object('scrolledwindow1')
        # remove old children
        for child in sw.get_children():
            sw.remove(child)
        sw.add(canvas)
        sw.show_all()
开发者ID:Hillash,项目名称:QuantPy,代码行数:18,代码来源:app.py


示例11: init_gui

    def init_gui(self):
        self.builder = Gtk.Builder()
        self.builder.add_from_file("finally.glade")

        self.builder.connect_signals( 
                                    {
                                      "window_destroy"  : self.window_destroy,
                                      "press_button"    : self.press_button,
                                      "clear_text"      : self.clear_text,
                                      "remove_last_char": self.remove_last_char,
                                      "calculate"       : self.calculate,
                                      "switch_page"     : self.switch_page,
                                      "num_base_change" : self.num_base_change,
                                      "fix_cursor"      : self.fix_cursor,
                                      "enable_textview" : self.enable_textview,
                                      "disable_textview": self.disable_textview,
                                      "prog_calc"       : self.prog_calc,
                                      "back_to_future"  : self.back_to_future,
                                      "plot"            : self.plot
                                    }
                                    )

        self.window = self.builder.get_object("main_window")
        self.window.set_size_request(250,305)
        self.window.set_title("The Calculator")
        self.window.set_icon_from_file("/usr/share/pixmaps/thecalculator-icon.png")
        self.text_buff = self.builder.get_object("class_17").get_buffer()  # Access buffer from TextView
        self.builder.get_object("class_17").grab_focus()
        self.builder.get_object("radiobutton3").set_active(True)
        self.num_base_change(self.builder.get_object("radiobutton3"))

        ############### PLOT FUNCTION ##############

        sw = self.builder.get_object("scrolledwindow1")
        sw2 = self.builder.get_object("scrolledwindow2")

        fig = Figure(figsize=(5,5),dpi=120)
        self.ax = fig.add_subplot(111)

        self.x = arange(-3.1415,3.1415,0.01)
        self.y = sin(self.x)

        self.ax.plot(self.x,self.y,label="sin(x)")
        self.ax.set_xlim(-3.2,3.2)
        self.ax.set_ylim(-1.2,1.2)
        self.ax.grid(True)

        fig.set_size_inches(9.5, 5.5, forward=True)

        fig.tight_layout()

        self.canvas = FigureCanvas(fig)
        sw.add_with_viewport(self.canvas)
        self.canvas.show()

        toolbar = NavigationToolbar(self.canvas, self.window)
        sw2.add_with_viewport(toolbar)
开发者ID:barvirm,项目名称:The-Calculator-v2.0,代码行数:57,代码来源:main.py


示例12: __init__

    def __init__(self, main_window, settings, data, add_layer_dataset, add_feature, redraw_main):
        """
        Initializes the RotationDialog class.

        Requires the main_window object, the settings object (PlotSettings
        class) and the data rows to initialize. All the necessary widgets are
        loaded from the Glade file. A matplotlib figure is set up and added
        to the scrolledwindow. Two axes are set up that show the original and
        rotated data.
        """
        self.builder = Gtk.Builder()
        self.builder.set_translation_domain(i18n().get_ts_domain())
        script_dir = os.path.dirname(__file__)
        rel_path = "gui_layout.glade"
        abs_path = os.path.join(script_dir, rel_path)
        self.builder.add_objects_from_file(abs_path,
            ("dialog_rotation", "adjustment_rotation_dipdir",
             "adjustment_rotation_dip", "adjustment_rotation_angle"))
        self.dialog = self.builder.get_object("dialog_rotation")
        self.dialog.set_transient_for(main_window)
        self.settings = settings
        self.data = data
        self.trans = self.settings.get_transform()
        self.add_layer_dataset = add_layer_dataset
        self.add_feature = add_feature
        self.redraw_main = redraw_main

        self.adjustment_rotation_dipdir = self.builder.get_object("adjustment_rotation_dipdir")
        self.adjustment_rotation_dip = self.builder.get_object("adjustment_rotation_dip")
        self.adjustment_rotation_angle = self.builder.get_object("adjustment_rotation_angle")

        self.spinbutton_rotation_dipdir = self.builder.get_object("spinbutton_rotation_dipdir")
        self.spinbutton_rotation_dip = self.builder.get_object("spinbutton_rotation_dip")
        self.spinbutton_rotation_angle = self.builder.get_object("spinbutton_rotation_angle")

        self.scrolledwindow_rotate = self.builder.get_object("scrolledwindow_rotate")

        self.fig = Figure(dpi=self.settings.get_pixel_density())
        self.canvas = FigureCanvas(self.fig)
        self.scrolledwindow_rotate.add_with_viewport(self.canvas)

        gridspec = GridSpec(1, 2)
        original_sp = gridspec.new_subplotspec((0, 0),
                                             rowspan=1, colspan=1)
        rotated_sp = gridspec.new_subplotspec((0, 1),
                                           rowspan=1, colspan=1)
        self.original_ax = self.fig.add_subplot(original_sp,
                                         projection=self.settings.get_projection())
        self.rotated_ax = self.fig.add_subplot(rotated_sp,
                                         projection=self.settings.get_projection())

        self.canvas.draw()
        self.redraw_plot()
        self.dialog.show_all()
        self.builder.connect_signals(self)
        if sys.platform == "win32":
            translate_gui(self.builder)
开发者ID:gbtami,项目名称:innstereo,代码行数:57,代码来源:rotation_dialog.py


示例13: run_inner

 def run_inner(self, endog, exog, **kwargs ):
     
     signs = ['x', '+']
     colours = ['r', 'b']
             
     f = plt.figure()
     
     var_index = 0
     for var in exog.columns:
         sign = signs[var_index % len( signs )]
         colour = colours[var_index % len( colours )]
         plt.plot( endog, exog[var], colour+sign )
         var_index += 1
     
     canvas = FigureCanvas( f )
     
     self.ui.output_vbox.pack_start( canvas, True, True, 0 )
     canvas.show()
     self.ui.output_dialog.run()
     self.ui.output_dialog.hide()
开发者ID:toobaz,项目名称:grimm,代码行数:20,代码来源:actions_matplotlib.py


示例14: setup

    def setup(self):
        fig = Figure(figsize=(10, 10), dpi=100, facecolor="white", edgecolor="white")
        self.ax = fig.add_subplot(111)
        fig.subplots_adjust(left=0.1, right=0.90, top=0.95, bottom=0.05)
        # ensure the pie is round
        self.ax.set_aspect('equal')

        matplotlib.rc('font', family="sans", weight="normal", size=9)

        self.plot = FigureCanvas(fig)
        self.pack_start(self.plot, True, True, 0)
开发者ID:avernusheros,项目名称:avernus,代码行数:11,代码来源:charts.py


示例15: __init__

    def __init__(self, pid):
        Gtk.Window.__init__(self, title="Auto-tune")
        self.pid = pid
        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        f = matplotlib.figure.Figure()
        self.axes = f.add_subplot(111)
        self.axes.set_xlabel('Time (sec.)')
        self.axes.set_ylabel('Temperature (C)')
        self.axes.autoscale()
        self.out_axes = self.axes.twinx()
        self.out_axes.set_ylabel('OUT (%)')
        self.out_axes.autoscale()
        self.axes.grid()
        self.pv_x = []
        self.pv_y = []
        self.sv_x = []
        self.sv_y = []
        self.out_x = []
        self.out_y = []
        self.pv_plot, = self.axes.plot(self.pv_x, self.pv_y, 'b--') #b
        self.sv_plot, = self.axes.plot(self.sv_x, self.sv_y, 'k-') #k
        self.out_plot, = self.out_axes.plot(self.out_x, self.out_y, 'r:') #r

        self.canvas = FigureCanvas(f)
        self.canvas.set_size_request(800,600)

        vbox.add(self.canvas)

        hbox = Gtk.Box()

        self.start = Gtk.Button('Start', Gtk.STOCK_EXECUTE)
        self.start.connect('clicked', self.on_start)
        self.start.set_sensitive(False)
        hbox.pack_start(self.start, False, False, 0)

        self.stop = Gtk.Button('Stop', Gtk.STOCK_STOP)
        self.stop.connect('clicked', self.on_stop)
        self.stop.set_sensitive(False)
        hbox.pack_start(self.stop, False, False, 0)

        button = Gtk.Button('Close', Gtk.STOCK_CLOSE)
        button.connect('clicked', self.on_close)
        hbox.pack_end(button, False, False, 0)

        vbox.add(hbox)

        self.add(vbox)
        self.run = True
        self.start_at = True
        self.stop_at = False
        self.d = self.loop()
        self.d.addErrback(lambda x: None)
        self.connect('delete-event', self.on_delete)
开发者ID:RickCarmichael,项目名称:set64rs,代码行数:54,代码来源:autotune.py


示例16: setup_matplotlib_widget

    def setup_matplotlib_widget(self):
        self.figure = Figure(dpi=72)

        self.plot = self.figure.add_subplot(111)
        self.figure.subplots_adjust(bottom=0.20)

        self.matlib_canvas = FigureCanvasGTK(self.figure)

        self.plot.autoscale_view()

        self.graph_parent.add(self.matlib_canvas)
        self.graph_parent.show_all()
开发者ID:mathijs-dumon,项目名称:PyXRD,代码行数:12,代码来源:views.py


示例17: EditAtomTypeView

class EditAtomTypeView(BaseView):
    builder = resource_filename(__name__, "glade/atoms.glade")
    top = "edit_atom_type"
    widget_format = "atom_%s"

    # ------------------------------------------------------------
    #      Initialisation and other internals
    # ------------------------------------------------------------
    def __init__(self, *args, **kwargs):
        BaseView.__init__(self, *args, **kwargs)

        self.graph_parent = self["view_graph"]
        self.setup_matplotlib_widget()

    def setup_matplotlib_widget(self):
        self.figure = Figure(dpi=72)

        self.plot = self.figure.add_subplot(111)
        self.figure.subplots_adjust(bottom=0.20)

        self.matlib_canvas = FigureCanvasGTK(self.figure)

        self.plot.autoscale_view()

        self.graph_parent.add(self.matlib_canvas)
        self.graph_parent.show_all()

    # ------------------------------------------------------------
    #      Methods & Functions
    # ------------------------------------------------------------
    def update_figure(self, x, y):
        self.plot.cla()
        self.plot.plot(x, y, 'k-', aa=True)
        self.plot.set_ylabel('Scattering factor', size=14, weight="heavy")
        self.plot.set_xlabel('2θ', size=14, weight="heavy")
        self.plot.autoscale_view()
        if self.matlib_canvas is not None:
            self.matlib_canvas.draw()
开发者ID:mathijs-dumon,项目名称:PyXRD,代码行数:38,代码来源:views.py


示例18: __init__

 def __init__(self):
     # ### Initialise les datas###
     self.array_size = 10
     self.nbr_dots = 1
     # ###########################
     self.builder = Gtk.Builder()  # voir commentaires lignes 21-25
     # self.builder = gtk.Builder()
     self.builder.add_from_file(os.path.join(os.getcwd(), 'TBench_GUI_gl3.ui'))
     self.window = self.builder.get_object('dialog1')
     self.aboutdialog = self.builder.get_object('aboutdialog1')
     self.assistant = self.builder.get_object('assistant1')
     self.textview = self.builder.get_object('textview1')
     self.textbuffer = self.builder.get_object('textbuffer1')
     self.bt_exit = self.builder.get_object('bt_exit')
     self.tbt_state0 = self.builder.get_object('tbt_state0')
     self.tbt_state1 = self.builder.get_object('tbt_state1')
     self.tbt_state2 = self.builder.get_object('tbt_state2')
     self.imagemenuitem5 = self.builder.get_object('imagemenuitem5')
     self.imagemenuitem10 = self.builder.get_object('imagemenuitem10')
     self.builder.connect_signals(self)
     self.bufsize = 10  # ajout 20.02
     self.databuffer = collections.deque([0.0] * self.bufsize, self.bufsize)  # ajout 20.02
     self.x = [1 * i for i in range(-self.bufsize + 1, 1)]  # ajout 20.02(-self.bufsize+1,1)
     # Matplotlib trucs
     self.figure = Figure(figsize=(100, 100), dpi=100)
     self.ax = self.figure.add_subplot(111)
     self.canvas = FigureCanvas(self.figure)  # une gtk.DrawingArea
     self.line, = self.ax.plot(self.x, self.databuffer)
     # Gtk trucs
     self.canvas.show()
     self.graphview = self.builder.get_object("plot")
     self.graphview.pack_start(self.canvas, True, True, True)
     self.arrow = self.builder.get_object('arrow1')
     self.window.connect('delete-event', self.quit)
     self.tbt_state0.connect('toggled', self.on_button_toggled0)
     self.tbt_state1.connect('toggled', self.on_button_toggled1)
     self.tbt_state2.connect('toggled', self.on_button_toggled2)
     self.bt_exit.connect('clicked', self.quit)
     self.imagemenuitem5.connect('activate', self.quit)
     self.imagemenuitem10.connect('activate', self.show_aboutdialog)
     self.window.show()
     # ================= Recherche du port de l'arduino ====================
     self.sonde = arduino.search()
     if self.sonde == "impossible d'ouvrir un port série":
         info = (self.sonde + "!" + '\n' +
                 "quitter cette session, vérifier la connexion avec le PLC, puis relancer le programme")
         self.ajout_log_term("TB", info)
     else:
         self.ajout_log_term("PLC", self.sonde)
         self.init_arduino()  # initialise l'arduino
开发者ID:euchcat,项目名称:TBenchGUI_Py3,代码行数:50,代码来源:TBench_GUI_py3.py


示例19: Pie

class Pie(ChartBase):

    def setup(self):
        fig = Figure(figsize=(10, 10), dpi=100, facecolor="white", edgecolor="white")
        self.ax = fig.add_subplot(111)
        fig.subplots_adjust(left=0.1, right=0.90, top=0.95, bottom=0.05)
        # ensure the pie is round
        self.ax.set_aspect('equal')

        matplotlib.rc('font', family="sans", weight="normal", size=9)

        self.plot = FigureCanvas(fig)
        self.pack_start(self.plot, True, True, 0)

    def draw_plot(self):
        self.ax.clear()
        self.ax.pie(self.controller.values.values(),
                    labels=self.controller.values.keys(),
                    autopct='%1.1f%%',
                    colors=self.colors
                    )
        # show pie
        self.spinner.hide()
        self.plot.show()
开发者ID:avernusheros,项目名称:avernus,代码行数:24,代码来源:charts.py


示例20: setup_image_box

 def setup_image_box(self):
     
     xx = self.xsize / float(self.dpi)    # inches
     yy = self.ysize / float(self.dpi)    # inches
     
     # TODO: make it resizable
     self.fig = Figure(figsize=(xx, yy), dpi=self.dpi)
     self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea 
     
     # setup drawing canvas
     self.canvas.set_size_request(self.xsize, self.ysize) 
     self.canvas.connect('button-press-event'  , self.on_canvas_button_press)
     self.canvas.connect('button-release-event', self.on_canvas_button_release)
     self.canvas.connect('motion-notify-event' , self.on_canvas_motion_notify)
     self.image_box.add(self.canvas)  
开发者ID:TarasKuzyo,项目名称:python-fractals,代码行数:15,代码来源:julia-fractal.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python backend_gtkagg.FigureCanvasGTKAgg类代码示例发布时间:2022-05-27
下一篇:
Python backend_gtk3agg.FigureCanvasGTK3Agg类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap