473,499 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to show graph as a slideshow in PyQt5.

1 New Member
I am trying to build a software for graph plotting where graph can be shown as a slideshow so that the data can be clearly visualised. First I wish to plot a set of data then after a specific time interval next set of data and so on.

I have a text file contains data as:

0.00 -10.742 10.7888 6.33455
1.00 -17.75391 10.0000 4.66778
4.00 -19.62891 15.9999 4.232323
20.00 -20.7641 18.6666 3.99999
23.00 -34.2300 2.7777 2.00000
50.00 -50.000 1.87878 2.77778
65.88 -22.5000 2.99999 1.45555
78.00 -30.000 1.55555 2.45667
86.00 -37.7900 2.55556 7.55679
90.00 -45.00000 13.6667 2.677888
----
----
200.02 200.01 0.0000 2.6667
300.00 300.02 1.6666 2.7878

What I have tried is:

Expand|Select|Wrap|Line Numbers
  1.     class MatplotlibWidget(QMainWindow):
  2.             ----
  3.             self.playbutton.clicked.connect(self.drawGraph)
  4.             ---       
  5.  
  6.         def drawGraph(self):
  7.             f1 = open('TESTIP2.txt', 'r')            
  8.             data = np.genfromtxt(f1)
  9.             m = np.size(data, 0)           
  10.             x = data[:, 0].reshape(m, 1)
  11.             y = data[:, 1].reshape(m, 1)
  12.             iters = m // 4
  13.             xs=[]
  14.             ys=[]
  15.             for i in range(iters):
  16.                 xs.append(x[i])
  17.                 ys.append(y[i])
  18.             self.MplWidget.canvas.axes.clear()
  19.             self.MplWidget.canvas.axes.plot(xs,ys)
  20.             self.MplWidget.canvas.axes.legend(('cosinus', 'sinus'), loc='upper right')
  21.             self.MplWidget.canvas.axes.set_title('Signal' )
  22.             self.MplWidget.canvas.draw()
  23.  
  24.     if __name__ == "__main__":
  25.  
  26.         app = QApplication([])
  27.         window = MatplotlibWidget()
  28.         window.show()
  29.         app.exec_()
Currently only first set of data is working . I wish to plot next set of data from same file after a specific time interval, say 10 sec. Likewise I am trying to show next and so on.
Mar 10 '19 #1
0 1081

Sign in to post your reply or Sign up for a free account.

Similar topics

7
3045
by: Rudy | last post by:
Hello All! After working in the television industry, moving to a developing career has been interesting to say the least. 3 years of developing with books, and the help of you fine folks on this...
22
5095
by: bevoldjling | last post by:
Hi ! I need some help in putting together a website for our family gathering. Although I'm still pretty "green", I don't think what I need requires terribly advanced skills ...except for one...
1
1394
by: The Starmaker | last post by:
Is there a command I can add to this script that will end the slideshow at the last image so it doesn't run continously? Pic = '1.jpg' Pic = '2.jpg' Pic = '3.jpg' Pic = '4.jpg' Pic = '5.jpg' ...
1
3333
by: ttamilvanan81 | last post by:
Hai everyone, I need to provide the slideshow for the images. I have upload the images into database. Then i will retrive all the images from the database and provide the slideshow for those...
1
1127
by: praveenrajb | last post by:
plz anyone help me to use graph in vb6.0 am doing project for an education institute in vb6.0,the student's admission details should be shown using graph..i.e if more students get admitted in...
2
1348
helimeef
by: helimeef | last post by:
Hiya, I'm upgrading a this slideshow to Object Oriented code (so I can reuse it for other clients), and I'm having some problems getting the library to work. Here is what it's like so far:...
2
1356
by: suvarna | last post by:
Hi. I'm not much familiar with VB 6. Could you please tell me how do I develop an application that shows a graph? The graph starts with a base value and must increment linearly.
0
3456
by: eureka2050 | last post by:
Hi all, I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:- include ("./jpgraph/src/jpgraph.php"); include ("./jpgraph/src/jpgraph_radar.php"); //...
3
1987
by: gmani | last post by:
Hi all, I'm new to FLASH.. i need your help to show Image slideshow like, http://slideshowpro.net/examples/floating (or) www.flickr.com Basically i'm asp.net programmer i can create runtime...
0
1304
KeredDrahcir
by: KeredDrahcir | last post by:
I needed a slide show that showed an image wider than my browser window so that at higher resolutions to image would still fill the screen. To prevent getting scroll bars on a lower resolutions...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.