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 Updated to NodeBB v4.3 + New Features

How to show plots(Matlablib) on Qlabel Pyqt5

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 5.9k Views 1 Watching
  • 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 21 Mar 2018, 13:10 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!

    J E 2 Replies Last reply 21 Mar 2018, 13:26
    0
    • D Dl10
      21 Mar 2018, 13:10

      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!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 21 Mar 2018, 13:26 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 21 Mar 2018, 13:34 last edited by
        #3

        i want to show plot on Qlabel in my app

        J 1 Reply Last reply 21 Mar 2018, 13:36
        0
        • D Dl10
          21 Mar 2018, 13:34

          i want to show plot on Qlabel in my app

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 21 Mar 2018, 13:36 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 25 Mar 2018, 12:48 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

            M 1 Reply Last reply 25 Mar 2018, 17:30
            0
            • D Dl10
              25 Mar 2018, 12:48

              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

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 25 Mar 2018, 17:30 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 26 Mar 2018, 07:39 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

                J 1 Reply Last reply 26 Mar 2018, 08:42
                0
                • D Dl10
                  26 Mar 2018, 07:39

                  @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

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 26 Mar 2018, 08:42 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
                  • M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 26 Mar 2018, 08:49 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
                      21 Mar 2018, 13:10

                      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 13 Nov 2018, 19:49 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