How do i go about embedding a matplotlib graph into Qt?

  • I have some matplotlib graphs i would like to embed in my app. When designing the window in QtDesigner i chose 2 Graphviews where i intend to display the graphs. How do i go about from here?

            with open("path") as graphFile:
                dataDict = json.load(graphFile)
            dataFrame = pandas.DataFrame.from_dict(dataDict, orient='index')

    Also, on a side note, i have 2 more issues i would like to solve:

    1. will the embeded graph keep the proportions of the window it's placed inside? I noticed that the default graph is square yet my window is rectangular and would like to fill all of it

    2. How can i make the graph interactive? Say hover over a value on X-axis and a small tool tip would appear with some extra details about that specific entry?


  • Lifetime Qt Champion

Log in to reply