PySimpleGUI / PySimpleGUI/PySimpleGUI

[Question]: Matplotlib + PySimpleGUIQt in the Main Window

Offen
#5,373 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Matplotlib Port - Qt Question
Vorherrschende Sprache
Python
Sterne
13.8k
Forks
1.8k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit Demo_Matplotlib_Image_Elem.py und untersuche, wie sg.Image() den Plot in ein Fenster einbettet. Vergleiche diesen Ansatz mit dem sg.Canvas() des Qt-Ports und anderen Qt-Beispielen und ermittle anschließend, ob ein unterstützter Plotting-Pfad im Hauptfenster dokumentiert oder hinzugefügt werden sollte.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
matplotlib, python
Bereich
data-visualization, desktop
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.