GTK3-Matplotlib-Cookbook | integrate Matplotlib as a widget into GTK applications | Widget library
kandi X-RAY | GTK3-Matplotlib-Cookbook Summary
kandi X-RAY | GTK3-Matplotlib-Cookbook Summary
##Reading the Book ##Progress The book is currently under development. ##Participation You can participate by forking the repository or opening an issue at the repository. ##Code Review This reposistory is monitored by Landscape (
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Update the zoom
- Zoom the plot
- Renders the plot
- Draw the zoom level
- Removes the selected item
- Plot the points
- Reset plot
- Draw the sample
- Reset plot
- Plot points in liststore
- Update the x - axis
- Update the y - axis
- Add a new row to the plot
GTK3-Matplotlib-Cookbook Key Features
GTK3-Matplotlib-Cookbook Examples and Code Snippets
Community Discussions
Trending Discussions on GTK3-Matplotlib-Cookbook
QUESTION
I've inserted two matplotlib graphs into a container using GTK3, Python, and Glade. They plot the weather of a locale using data from a third-party API. I want the graphs to update when I enter a new locale and press a refresh button.
Each of the solutions below ended with different problems. Too many to delineate. Generally, they've managed to display another instance of the main window with the new charts, but the old instance with the old charts remain open. I've tried:
Destroying the parent container and then reloading an updated one. The following code produces a segmentation fault. The code tries to pass an object from a new instance of the builder to the old one. I believe this to be my main problem. I don't know how to pass the instance of the builder I'm working with into
...on_refresh_button_click()
without having to rewrite everything into a single class.
ANSWER
Answered 2018-Dec-12 at 15:41I am not sure I can give you an example that works with your existing code, but here is how I did it:
QUESTION
I have built an application using Glade and PyGObject. Now, I am trying to include a section on my GUI which can display plots based on some selection. After some research, I found that I can include plots generated using matplotlib as seen in this example: https://github.com/tobias47n9e/GTK3-Matplotlib-Cookbook/blob/master/examples/matplotlibwindow.py
I tried the example and it works fine. Following the code, I added a scrolled window (to the grid in the main window) using the following line:
...ANSWER
Answered 2018-Sep-07 at 07:11What seems to be missing in your set_charts
method is a self.canvas.show()
and self.scrolledwin.show()
. Every time you add something to the gui you have to call its show
method or the show_all
method of its container widget.
In the example you linked, all the widgets are added in the same level (the script level) and my_first_window.show_all()
is called to show the window and all its children at the end.
Since you're adding the self.scroledwin
and self.canvas
widgets in a method (I'm assuming, after you've called self.your_main_window.show_all()
, probably in the __init__
method) you need to show
those added widgets in order for them to be displayed.
Source: Gtk.Widget - gtk-widget-show
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GTK3-Matplotlib-Cookbook
You can use GTK3-Matplotlib-Cookbook like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page