|
From: Michael D. <md...@st...> - 2013-07-17 12:29:38
|
There is nothing available to push points -- matplotlib uses Numpy arrays internally for the data, and they can not be (efficiently) resized. I would try implementing this before assuming it's too slow. Mike On 07/05/2013 12:02 PM, v0idnull wrote: > Yes, but this is where I am failing. I don't have the code with me > right now but I can explain it: > > I get a new number every 2000 milliseconds, and I want to update the > graph say, every 50 milliseconds, and keep a minute of history visible > in the graph. > > So that's 30 x-axis ticks. > > But if I want to draw this out smoothly, I need 40 more ticks per > update interval. I have five lines I want to show, so every 50ms, 600 > points need to be plotted out. > > Now, my proof of concept code is just working with arrays in a sort of > FIFO queue, I haven't actually tried to plug those arrays into > matplotlib, but it seems like replotting 600 points is a lot of work. > > Maybe I am over reacting? Or is there some feature of matplotlib that > allows me to push data onto a plot instead of replotting all points? > > I dunno, I'm not confident in my approach. I seek inspiration. > > thanks, > --alex > > This means that every 50ms, 600 points need to be updated. > > On 13-07-04 05:11 PM, Michael Droettboom wrote: >> I see -- you want to basically interpolate between points? I don't >> think there's anything built in to matplotlib to do that, but you >> could always do that interpolation outside and just update the graph >> more often. >> >> Mike >> >> On 07/04/2013 04:28 PM, v0idnull wrote: >>> eh.... >>> >>> Let me explain my problem in a different way: >>> >>> Every two seconds I get a value from a service. Let's say I over 8 >>> seconds I get 1, 5, 10, 5 as values. >>> >>> So if my application updates the graph every two seconds, this will >>> look choppy and ugly. This is because every two seconds, an entire >>> line is added onto the graph between the two points. >>> >>> Imagine if I could control the drawing of said line though. If I >>> could draw the individual pixels of the line every couple of ticks >>> instead of just dumping a line in every two seconds, I will end up >>> with a nice smooth animation. It may not be 100% real time anymore, >>> but my focus on this personal project of mine is vanity, not >>> practicality ;) >>> >>> I hope this better explains what I am trying to accomplish... >>> >>> Thanks, >>> --alex >>> >>> On 13-07-04 04:09 PM, Michael Droettboom wrote: >>>> Have you looked at the simple_anim.py example -- other than the >>>> networking piece, it seems to do what you describe, and it's pretty >>>> fast. Maybe start from that and make changes until it gets slow in >>>> order to determine where the slowness comes from...? >>>> >>>> Mike >>>> >>>> On 07/03/2013 09:19 PM, v0idnull wrote: >>>>> I am receiving a number from a server every two seconds. I would >>>>> like to plot this number.out over time for the past say... 30 polls. >>>>> >>>>> Would it be possible to use... Anything, to produce a smooth >>>>> animation of the plot line getting drawn? As it stands now the >>>>> animation is well... Quite choppy. ;) >>>>> >>>>> I'm using pygame currently to render my graphs on this full screen >>>>> application I'm making just for my self. I am not bound to it >>>>> though if there are better linux-only things out there. >>>>> >>>>> Thanks in advance, >>>>> --alex >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> This SF.net email is sponsored by Windows: >>>>> >>>>> Build for Windows Store. >>>>> >>>>> http://p.sf.net/sfu/windows-dev2dev >>>>> >>>>> >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Mat...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by Windows: >>>> >>>> Build for Windows Store. >>>> >>>> http://p.sf.net/sfu/windows-dev2dev >>>> >>>> !DSPAM:51d5d60416102691037314! >>>> >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>>> >>>> !DSPAM:51d5d60416102691037314! >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Windows: >>> >>> Build for Windows Store. >>> >>> http://p.sf.net/sfu/windows-dev2dev >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> !DSPAM:51d5e4c116101841011479! >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> >> !DSPAM:51d5e4c116101841011479! >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> !DSPAM:51d5e4c116101841011479! > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |