How To Embed Matplotlib In PyQt5 (2018)

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

ความคิดเห็น • 36

  • @ParwizForogh
    @ParwizForogh  3 ปีที่แล้ว

    You can support me on Patreon
    www.patreon.com/parwizforogh

  • @baruchba7503
    @baruchba7503 6 ปีที่แล้ว +2

    If I'm correct, converting a QT Designer UI file to a .py file does this automatically. Possibly not for matplotlib and numbpy.

    • @ParwizForogh
      @ParwizForogh  6 ปีที่แล้ว

      converting is just for the ui files matplotlib or numpy, u can design u r main interface in qt designer after converting to .py u can add matplotlib functionality to that

    • @saeedullahwazir6713
      @saeedullahwazir6713 5 ปีที่แล้ว

      @@ParwizForogh let me know that i have a list which has data and i want to plot a graph in graphic View which i have already Design in QT designer .waiting for your reply

  • @tomdvh
    @tomdvh 6 ปีที่แล้ว +1

    Why would you create a new class for it?

  • @k2icc
    @k2icc 5 ปีที่แล้ว

    Anything like this displaying a stock chart? Thanks

    • @ParwizForogh
      @ParwizForogh  5 ปีที่แล้ว

      yea u can print every kind graphs

    • @k2icc
      @k2icc 5 ปีที่แล้ว

      @@ParwizForogh Did one and printed fine. Thanks a lot.

  • @Belissimo-T
    @Belissimo-T 5 ปีที่แล้ว

    Is there any code download? I've searched on his website and could't find it.

    • @ParwizForogh
      @ParwizForogh  5 ปีที่แล้ว

      this is the source code : codeloop.org/how-to-embed-matplotlib-graph-in-pyqt5/

  • @mahnoorahmed5536
    @mahnoorahmed5536 5 ปีที่แล้ว

    how to right align the graph ?

  • @baruchba7503
    @baruchba7503 6 ปีที่แล้ว

    Is this possible for 64 bit?

  • @officesuperhero9611
    @officesuperhero9611 6 ปีที่แล้ว +1

    Perfect timing! I need this lesson! Thanks.

  • @khazaddim
    @khazaddim 6 ปีที่แล้ว

    What IDE are you using? Nice video.

  • @RajGupta-sg7jn
    @RajGupta-sg7jn 4 ปีที่แล้ว

    hey this video really help me out, but can you make a video to update plots with radio buttons, as using canvas is just showing figures of what matplotlib is making

  • @giturperformance7986
    @giturperformance7986 ปีที่แล้ว

    Fantastic bro

  • @Taran72
    @Taran72 4 ปีที่แล้ว

    Great Video! thank you for the explanation and for sharing the code. you are a life saver! :)

  • @junyan1258
    @junyan1258 6 ปีที่แล้ว

    Great! Your video helped me to work out my course design! Thanks.

  • @swannproust9287
    @swannproust9287 5 ปีที่แล้ว +1

    Thanks. Wonderful video. I love it.

  • @ingmario7
    @ingmario7 6 ปีที่แล้ว +1

    Excelente explicación, lo felicito. ¿Cómo podría hacer un gráfico en tiempo real usando PyQy5? Saludos desde Venezuela.

  • @ibrahimallam7931
    @ibrahimallam7931 5 ปีที่แล้ว +6

    man !! you are writin your code like you are writing it to your self ,,,please explain what you do

  • @merrynet445
    @merrynet445 6 ปีที่แล้ว

    great! Thank you help me !

  • @greatindianbuilder2491
    @greatindianbuilder2491 3 ปีที่แล้ว

    It worked but i didn't understand anything. thankyou very much

  • @MinecraftXXXXL
    @MinecraftXXXXL 5 ปีที่แล้ว

    Add comments in your coding..

  • @XploreMotivation
    @XploreMotivation 5 ปีที่แล้ว

    How to plot the live streaming data in pyqt5? Please make one tutorial for the same.

    • @ParwizForogh
      @ParwizForogh  5 ปีที่แล้ว

      i will make

    • @XploreMotivation
      @XploreMotivation 5 ปีที่แล้ว

      @@ParwizForogh Please don't just create the basic visualization which everyone is doing. It will be great if you make the full tutorial on the same and if possible with the streaming data as well.

    • @XploreMotivation
      @XploreMotivation 5 ปีที่แล้ว +2

      Here is what I have achieved so far .
      # Import libraries
      from numpy import *
      from pyqtgraph.Qt import QtGui, QtCore
      import pyqtgraph as pg
      from random import randrange, uniform
      import serial
      # from scipy.fftpack import fft
      # Create object serial port
      portName = "COM12"
      baudrate = 9600
      # ser = serial.Serial(portName,baudrate)
      ### START QtApp #####
      app = QtGui.QApplication([]) # you MUST do this once (initialize things)
      ####################
      win = pg.GraphicsWindow(title="Signal from serial port")
      win.resize(1000,900)# creates a window
      p = win.addPlot(title="X WINDOW",row = 0, col = 0) # creates empty space for the plot in the window
      curve = p.plot(pen='r') # create an empty "plot" (a curve to plot)
      windowWidth = 900 # width of the window displaying the curve
      # windowHeight = 700
      Xm = linspace(0,0,windowWidth) # create array that will contain the relevant time series
      # print("XM VALUES ARE ",Xm)
      # print("Length is ",len(Xm))
      ptr = -windowWidth # set first x position
      p2= win.addPlot(title = 'Y WINDOW',row=1, col = 0)
      curve2= p2.plot(pen='g')
      #
      p3= win.addPlot(title = 'Z WINDOW',row=2, col = 0)
      curve3= p3.plot(pen='y')
      #Plot for FFT X
      # p4 = win.addPlot(title = "FFT X",row = 3,col = 0)
      # curve4 = p4.plot(pen='')
      #Plot for FFT Y
      # p5 = win.addPlot(title = "FFT Y",row = 4,col = 0)
      # curve5 = p5.plot(pen='o')
      #Plot for FFT Z
      # p6 = win.addPlot(title = "FFT Z",row = 5,col = 0)
      # curve6 = p6.plot(pen='y')
      # Realtime data plot. Each time this function is called, the data display is updated
      def update():
      global curve, ptr, Xm,curve2,curve3,curve4,curve5,curve6
      Xm[:-1] = Xm[1:] # shift data in the temporal mean 1 sample left
      # value = ser.readline() # read line (single value) from the serial port
      value = uniform(0,100)
      # print("Values are :",value)
      # print("Length of the values are : ",len(str(value)))
      Xm[-1] = float(value) # vector containing the instantaneous values
      # print("Xm is :",Xm[-1])
      ptr += 1 # update x position for displaying the curve
      curve.setData(Xm) # set the curve with this data
      curve.setPos(ptr,0) # set x position in the graph to 0
      curve2.setData(Xm)
      curve3.setData(Xm)
      # curve4.setData()
      # curve5.setData()
      # curve6.setData()
      QtGui.QApplication.processEvents() # you MUST process the plot now
      ### MAIN PROGRAM #####
      # this is a brutal infinite loop calling your realtime data plot
      while True: update()
      ### END QtApp ####
      pg.QtGui.QApplication.exec_() # you MUST put this at the end
      ################

    • @sabrinat345
      @sabrinat345 3 ปีที่แล้ว

      @@XploreMotivation hello, does your code work? I'm trying to display an ECG using matplotlib and PyQt5 but I'm struggling ( on a raspberry pi)

  • @GreenwayOo
    @GreenwayOo 5 ปีที่แล้ว +5

    0 explaination on what is what and why. I guess he doesn't really understand what he is doing.

  • @Kumar_h
    @Kumar_h 3 ปีที่แล้ว

    Sir, you did not explain a thing. You just repeated what you wrote with zero explanation.

  • @MrZack1497
    @MrZack1497 5 ปีที่แล้ว

    Good content, terrible presentation