Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to show plots(Matlablib) on Qlabel Pyqt5
Forum Update on Monday, May 27th 2025

How to show plots(Matlablib) on Qlabel Pyqt5

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dl10
    wrote on last edited by
    #1

    hi all,
    How i can show plots(Matlablib) on Qlabel Pyqt5?
    for example this is the plots with i make Matlablib:
    0_1521637898325_Untitled.jpg

    i want to show this grap on Qlabel(some image)
    tnx!

    jsulmJ E 2 Replies Last reply
    0
    • D Dl10

      hi all,
      How i can show plots(Matlablib) on Qlabel Pyqt5?
      for example this is the plots with i make Matlablib:
      0_1521637898325_Untitled.jpg

      i want to show this grap on Qlabel(some image)
      tnx!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Dl10 It's not clear: do you want to show a plot which is stored as a picture or do you want to plot in your app?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • D Offline
        D Offline
        Dl10
        wrote on last edited by
        #3

        i want to show plot on Qlabel in my app

        jsulmJ 1 Reply Last reply
        0
        • D Dl10

          i want to show plot on Qlabel in my app

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @Dl10 So, a picture? I'm still not sure what you exactly mean.
          If it is a picture use http://doc.qt.io/qt-5/qlabel.html#pixmap-prop
          or http://doc.qt.io/qt-5/qlabel.html#setPicture
          If you really want to plot take a look at https://doc.qt.io/qt-5.10/qtcharts-overview.html
          QLabel can't plot.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • D Offline
            D Offline
            Dl10
            wrote on last edited by
            #5

            the photo in my first commend i want to put in label.
            i don't want "pop up" show graph i want the graph on Qlabel

            mrjjM 1 Reply Last reply
            0
            • D Dl10

              the photo in my first commend i want to put in label.
              i don't want "pop up" show graph i want the graph on Qlabel

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Dl10
              Hi
              But how do you generate the image you want to show in the QLabel ?

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dl10
                wrote on last edited by
                #7

                @mrjj said in How to show plots(Matlablib) on Qlabel Pyqt5:

                Hi
                But how do you generate the image you want to show in the QLabel ?

                way --> from matplotlib import pyplot

                my code:
                pyplot.plot(Matrix)
                pyplot.show()
                and what this show i want to put on Qlabel

                jsulmJ 1 Reply Last reply
                0
                • D Dl10

                  @mrjj said in How to show plots(Matlablib) on Qlabel Pyqt5:

                  Hi
                  But how do you generate the image you want to show in the QLabel ?

                  way --> from matplotlib import pyplot

                  my code:
                  pyplot.plot(Matrix)
                  pyplot.show()
                  and what this show i want to put on Qlabel

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Dl10 Then I guess you need to use something like pyplot.save() instead of show(). I don't know whether it provides the possibility to save the plot as a picture.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi
                    Seems @jsulm has metal powers
                    I think you can use this t get image
                    https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imsave.html#matplotlib.pyplot.imsave

                    1 Reply Last reply
                    0
                    • D Dl10

                      hi all,
                      How i can show plots(Matlablib) on Qlabel Pyqt5?
                      for example this is the plots with i make Matlablib:
                      0_1521637898325_Untitled.jpg

                      i want to show this grap on Qlabel(some image)
                      tnx!

                      E Offline
                      E Offline
                      Eyyup
                      wrote on last edited by
                      #10

                      @Dl10 please watch following video to use Matplotlib with PyQt5

                      https://www.youtube.com/watch?v=2C5VnE9wPhk&t=3s

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved