Need help to solve performance problems

Hey all,

I?m trying to use matplotlib on a Raspberry Pi to visualize data the Pi receives via serial port - and of course I?m new to Python and matplotlib. The visualization need not be online, rather in form of a PDF once no more data is received. Then however as quick as possible. Please refer to my SO question for more details: http://stackoverflow.com/questions/35629471/need-help-to-solve-performance-problems-of-matplotlib-on-a-raspberry-pi
Nevertheless here is a brief summary: During the better part of an hour my program does nothing but wait for input on the serial port, which is received once a second. During this waiting time it could already begin rendering the chart, and then just save it to file, once it?s done. I have not found out how to do this however. Whats more, I have read quite discouraging posts concerning the need to recalculate the axes and so forth. As an alternative to rendering the entire grid in the program, I guess it would be an improvement (speedwise) if I could just use an image of the grid and repeat it (as in tiling). But I have not quite found the means to do that either. Concerning the grid layout please refer to my other SO question http://stackoverflow.com/questions/35551080/is-it-possible-to-generate-a-chart-with-this-very-specific-background.

Thanks a lot for reading?and perhaps answering :slight_smile:

Kind regards,
Oliver Holmes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160301/69509087/attachment.html>

Sounds like you are describing the need for blitting, which most of the
backends support in one way or another. The blitting pathways were designed
with animations in mind, but I don't see why it couldn't be hijacked for
your use as well. Note, you will have to do manual calls to
copy_from_bbox() and such, but it should be doable.

Ben Root

···

On Tue, Mar 1, 2016 at 9:21 AM, Holmes, Oliver <Oliver.Holmes at smtonline.de> wrote:

Hey all,

I?m trying to use matplotlib on a Raspberry Pi to visualize data the Pi
receives via serial port - and of course I?m new to Python and matplotlib.
The visualization need not be online, rather in form of a PDF once no more
data is received. Then however as quick as possible. Please refer to my SO
question for more details:
python - Need help to solve performance problems of matplotlib on a Raspberry Pi - Stack Overflow
Nevertheless here is a brief summary: During the better part of an hour my
program does nothing but wait for input on the serial port, which is
received once a second. During this waiting time it could already begin
rendering the chart, and then just save it to file, once it?s done. I have
not found out how to do this however. Whats more, I have read quite
discouraging posts concerning the need to recalculate the axes and so
forth. As an alternative to rendering the entire grid in the program, I
guess it would be an improvement (speedwise) if I could just use an image
of the grid and repeat it (as in tiling). But I have not quite found the
means to do that either. Concerning the grid layout please refer to my
other SO question
python - Is it possible to generate a chart with this very specific background? - Stack Overflow
.

Thanks a lot for reading?and perhaps answering :slight_smile:

Kind regards,
Oliver Holmes

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
Matplotlib-users Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160301/b360b2d5/attachment.html&gt;

Ah, turns out the Raspberry Pi is more powerful than I thought. It?s just being held down by web2py. When I ran my script outside of web2py? in pure python so to speak, it was performing adequately. So now I?m using subprocess to call that script, and am quite happy. A wee bit more text here: http://stackoverflow.com/questions/35629471/need-help-to-solve-performance-problems-of-matplotlib-on-a-raspberry-pi

So thanks for your insight, Ben. But that just seemed a bit too low-level for me. I just had to try something different.

Cheers,

Oliver

···

Am 01.03.2016 um 17:22 schrieb Benjamin Root <ben.v.root at gmail.com<mailto:ben.v.root at gmail.com>>:

Sounds like you are describing the need for blitting, which most of the backends support in one way or another. The blitting pathways were designed with animations in mind, but I don't see why it couldn't be hijacked for your use as well. Note, you will have to do manual calls to copy_from_bbox() and such, but it should be doable.

Ben Root

On Tue, Mar 1, 2016 at 9:21 AM, Holmes, Oliver <Oliver.Holmes at smtonline.de<mailto:Oliver.Holmes at smtonline.de>> wrote:
Hey all,

I?m trying to use matplotlib on a Raspberry Pi to visualize data the Pi receives via serial port - and of course I?m new to Python and matplotlib. The visualization need not be online, rather in form of a PDF once no more data is received. Then however as quick as possible. Please refer to my SO question for more details: http://stackoverflow.com/questions/35629471/need-help-to-solve-performance-problems-of-matplotlib-on-a-raspberry-pi
Nevertheless here is a brief summary: During the better part of an hour my program does nothing but wait for input on the serial port, which is received once a second. During this waiting time it could already begin rendering the chart, and then just save it to file, once it?s done. I have not found out how to do this however. Whats more, I have read quite discouraging posts concerning the need to recalculate the axes and so forth. As an alternative to rendering the entire grid in the program, I guess it would be an improvement (speedwise) if I could just use an image of the grid and repeat it (as in tiling). But I have not quite found the means to do that either. Concerning the grid layout please refer to my other SO question http://stackoverflow.com/questions/35551080/is-it-possible-to-generate-a-chart-with-this-very-specific-background.

Thanks a lot for reading?and perhaps answering :slight_smile:

Kind regards,
Oliver Holmes

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org<mailto:Matplotlib-users at python.org>
https://mail.python.org/mailman/listinfo/matplotlib-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160308/e3cf5737/attachment.html>