PySimpleGUI / PySimpleGUI/PySimpleGUI
[Question]: Matplotlib + PySimpleGUIQt in the Main Window
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.8k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Matplotlib + PySimpleGUIQt in the Main Window
Operating System
Windows 10
PySimpleGUI Port (tkinter, Qt, Wx, Web)
PySimpleGuiQt
Versions
Version information can be obtained by calling sg.main_get_debug_data()
Or you can print each version shown in ()
Python version (sg.sys.version)
3.7
PySimpleGUI Version (sg.__version__)
4.59 (for PySimpleGUI)
0.35 (for PySimpleGUIQt)
GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)
5.13.2 (for PySide2)
Your Experience In Months or Years (optional)
Years Python programming experience
Years Programming experience overall
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
I have used a little of PyQt5 before
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
- Searched main docs for your problem www.PySimpleGUI.org
- Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
- If not tkinter - looked for Demo Programs for specific port
- For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
- Run your program outside of your debugger (from a command line)
- Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
- Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description
I originally had created a small GUI in the tkinter port (PySimpleGUI), but found out later that background images were a bit difficult to implement. I saw the demo program but was not crazy about the look of it. I instead have been attempting to switch to the PySimpleGUIQt port because I like how it can implement a background image, and it looks cleaner. After some trial and error I was able to plot with matplotlib by using the Image widget. Seems to work, but was curious if there were other ways to plot using PySimpleGUIQt. For example, in the tkinter port it has the sg.Canvas() ability. I haven't had any luck though using the Canvas in the qt port, (because it is not allowed in the Qt port I guess).
I would like to plot using matplotlib (could be simple graph, or 2D filled contour plot) in the main window. Like I mentioned I was able to use the sg.Image() function to create a plot when a button was hit through the demo: "Demo_Matplotlib_Image_Elem.py". However, I have found it hard to find information on plotting specifically for the qt port. Almost all the demos/questions are for the tkinter port. Is the sg.Image() widget the only way to currently plot using Matplotlib into the main window for the qt port? Any guidance would be much appreciated, thanks!
Code To Duplicate
A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)
This pre-formatted code block is all set for you to paste in your bit of code:
# Paste your code here
Screenshot, Sketch, or Drawing
Watcha Makin?
If you care to share something about your project, it would be awesome to hear what you're building.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Demo_Matplotlib_Image_Elem.py and inspect how sg.Image() embeds the plot in a window. Compare that approach with the Qt port's sg.Canvas() and other Qt examples, then determine whether a supported main-window plotting path should be documented or added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization, desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100