473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to handle output window minimize/movement in interactive mode of matplotlib

I want to dynamically update the scatter plot based on the y-axis data received from a socket connection. I used python matplot lib in interactive mode to do this, but during dynamic updation if i move the window to a different location or minimize the window then the plot updation stops abruptly. Please let me know how to do this?

I have attached a sample dynamic updation code used here and the same problem appears here also, please help.
Expand|Select|Wrap|Line Numbers
  1. import matplotlib.pyplot as plt
  2. import random
  3. import time
  4. items = [25.5,26.7,23.4,22.5,20,13.4,15.6,-12,-16,20]
  5. x = [1,2,3,4,5,6,7,8,9,10]
  6.  
  7. plt.ion() #  Interactive on
  8.  
  9. for i in range(1,100):
  10.     plt.title('graph plotting')
  11.     plt.ylabel('temperature')
  12.     plt.xlabel('time')
  13.     random.shuffle(items)
  14.     plt.plot(x,items,'ob-')
  15.     plt.axis([0, 10, -40, 40])
  16.     plt.draw()
  17.     #time.sleep(2)
  18.     plt.clf()
  19. plt.close()
Dec 21 '09 #1
2 3484
Glenton
391 Expert 256MB
Hi

If you manage to do this, I'd be very interested! I use matplotlib to make my plots for papers, presentations etc, but also use python to control experiments, and couldn't figure out how to do this exact thing with matplotlib, although I didn't try as hard as I could yet! Still somewhere down there on my to do list!

Anyway, the way I solved it was with gnuplot, and the corresponding gnuplot module for python. I don't really know how to use gnuplot, but you don't really have to, as it's a similar kind of interface to matplotlib.

However, I have a feeling there's a python mega widget (PMW) or something similar that might be better still for this purpose. I vaguely remember seeing something about this in Langtangen's excellent Python Scripting for Computational Scientists. I'll try to remember to look it up when I get back to the office.
Dec 27 '09 #2
Ya I figured out how to do this...You need to use wxPython with matplotlib for this purpose...refer this link for more
http://eli.thegreenplace.net/2008/08...wxpython-guis/
Dec 28 '09 #3

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

Similar topics

3
by: Moosebumps | last post by:
Is there anything that is made to generate web pages which have charts similar to the yahoo finance stock charts? Not looking to graph stocks specifically, but anything. I like how you can zoom...
0
by: Andrej Dzerzhinsky | last post by:
I'm building a scientific app using wxPython to call some C functions together with a suitable plotting application that will work within a wxPython frame. I'd like to plot a spline over several...
1
by: Darren Dale | last post by:
Hello, I use Python for interactive data analysis, coming recently from Matlab. One thing I am missing is a variable browser. The problem with vars() is that it lists everything loaded in the...
4
by: Brad Jones | last post by:
<Previously posted in microsoft.public.dotnet.framework.windowsforms> Hi all. Any suggestions here would be appreciated. Thanks for reading. I'm primarly a C++ developer but I've been trying to...
5
by: Christophe HELFER | last post by:
Hi, I would like to do this in VB Languague. I have an executable file in DOS mode. This executable returns informations and display them to the DOS window. Unfortunately, I have to process...
0
by: F.C. | last post by:
Hello, :) I'm currently writing a frontend for a console application using VB .net. I'm using the traditional Process creation to launch it and redirect input and output to my windows...
20
by: Ilias Lazaridis | last post by:
IDLE has an output format like this: <type 'object'> <type 'type'> <type 'type'> How can I customize it to become like that: <type 'object'> <type 'type'>
8
by: Boki | last post by:
Hi All, I want to force a window ( form, handle ) become foreground, I use: FindWindow and SetForegroundWindow
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.