Re: [Matplotlib-users] Broken pipe error when saving animation for html5

2016-02-24 Thread Kyle Douglass
>
> Try running with '--verbose-debug' as in:
>
> python basic_example_writer.py --verbose-debug
>

Thanks for the suggestion, Ryan. By doing so I discovered that the error
was caused by ffmpeg not finding the libx264 library; the error was not at
all connected with matplotlib.

As it turns out, I neglected to use the *--enable-libx264 --enable-gpl
--enable-nonfree* flags when running the configuration script for ffmpeg
just before compiling. I recompiled ffmpeg and now everything is working
properly.

Thanks again,
Kyle
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Broken pipe error when saving animation for html5

2016-02-24 Thread Ryan May
Try running with '--verbose-debug' as in:

python basic_example_writer.py --verbose-debug

That should give you standard out and standard error from running ffmpeg,
which might be illustrative.

x264 is probably the most universally supported codec for html5 video.
Another option would be to use imagemagick with the ImagemagickWriter and
make an animated gif.

Ryan

On Wed, Feb 24, 2016 at 1:34 PM, Kyle Douglass 
wrote:

> Hi all,
> I would like to use matplotlib's animation API to create a movie that can
> be embedded into an html5 video tag. To do this, I am following a couple
> 2012 blog posts from Jake VanderPlas:
> http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/
> and
> http://jakevdp.github.io/blog/2013/05/12/embedding-matplotlib-animations/
>
> My understanding is that I need to use the x264 codec to do this.
> Unfortunately, I get a Broken Pipe Error when running the basic example
> below. I get the same error when calling the animation.to_html5_video()
> method.
>
> Does anyone have an idea about why I'm getting the Broken Pipe error? Do I
> really need the x264 codec to embed matplotlib animations into html? Thanks!
>
> Kyle
>
> *Example code:*
>
> *import numpy as np*
>
> *import matplotlib.pyplot as plt*
>
> *from matplotlib import animate*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *fig   = plt.figure()ax= plt.axes(xlim = (0, 2), ylim = (-2, 2))line,
> = ax.plot([], [], linewidth = 2)# initialization function: plot the
> background of each framedef init():line.set_data([], [])return
> line,# animation function.  This is called sequentiallydef animate(i):x
> = np.linspace(0, 2, 1000)y = np.sin(2 * np.pi * (x - 0.01 * i))
> line.set_data(x, y)return line,# call the animatoranim =
> animation.FuncAnimation(fig, animate,
> init_func=init,   frames=200, interval=20,
> blit=True)myWriter = animation.FFMpegWriter(fps = 30,
> extra_args=['-vcodec', 'libx264'])anim.save('basic_animation.mp4', writer =
> myWriter)*
> *plt.show()*
>
> *Traceback:*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *Traceback (most recent call last):  File "test.py", line 26, in
> anim.save('basic_animation.mp4', writer = myWriter)  File
> "/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py",
> line 810, in save
> writer.grab_frame(**savefig_kwargs)  File
> "/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py",
> line 230, in grab_frame
> dpi=self.dpi, **savefig_kwargs)  File
> "/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/figure.py",
> line 1565, in savefig
> self.canvas.print_figure(*args, **kwargs)  File
> "/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py",
> line 196, in print_figure
> FigureCanvasAgg.print_figure(self, *args, **kwargs)  File
> "/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/backend_bases.py",
> line 2232, in print_figure
> **kwargs)  File
> "/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py",
> line 519, in print_raw
> fileobj.write(renderer._renderer.buffer_rgba())BrokenPipeError: [Errno 32]
> Broken pipe*
>
> I'm using Anaconda/Python 3.5 with matplotlib 1.5.1. I installed FFmpeg
> 3.0 in Debian Jessie by compiling FFmpeg from source into a dpkg according
> to these instructions:
> http://superuser.com/questions/286675/how-to-install-ffmpeg-on-debian I
> also have Debian packages x264 and libx264-142 installed.
>
>
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>


-- 
Ryan May
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 1.5.1 - Function pcolormesh throws Segmentation Fault / faulthandler traceback info

2016-02-24 Thread Claude Falbriard
Dear colleagues, 

Thanks for the quick feedback. 

I've installed the "faulthandler" package, added it to the import and 
enabled it with faulthandler.enable(). 
Below the console trace of the test using the pcolormesh function and the 
traceback information: 

python test3.py

Fatal Python error: Segmentation fault

Current thread 0x03ffa45f7710 (most recent call first):
  File "/usr/lib64/python2.7/site-packages/matplotlib/collections.py", 
line 1877 in draw
  File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 61 
in draw_wrapper
  File "/usr/lib64/python2.7/site-packages/matplotlib/axes/_base.py", line 
2324 in draw
  File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 61 
in draw_wrapper
  File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 
1159 in draw
  File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 61 
in draw_wrapper
  File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", 
line 474 in draw
  File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", 
line 527 in print_png
  File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", 
line 2232 in print_figure
  File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 
1565 in savefig
  File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 688 
in savefig
  File "test3.py", line 47 in 
Segmentation fault

Hope this information helps to circle the issue. 


Regards,

Claude Falbriard
Certified IT Specialist L2 - Middleware


Phone: 55-13-99662-5703 | Mobile: 55-13-98117-3316
E-mail: clau...@br.ibm.com




From:   Benjamin Root 
To: Claude Falbriard/Brazil/IBM@IBMBR
Cc: Matplotlib Users 
Date:   24/02/2016 17:35
Subject:Re: [Matplotlib-users] Matplotlib 1.5.1 - Function 
pcolormesh throws Segmentation Fault



Sorry, forgot to post the link: https://pypi.python.org/pypi/faulthandler/

On Wed, Feb 24, 2016 at 3:33 PM, Benjamin Root  
wrote:
Could you try using faulthandler and post the traceback please? That'll 
help us isolate the problem better.

Ben Root

On Wed, Feb 24, 2016 at 3:04 PM, Claude Falbriard  
wrote:
Dear colleagues,

 I've done a build from source of latest Matplotlib package and deployed 
it at our IBM z13 machine (s390x). It uses the current release 1.5.1. 
During the unit tests I found an issue with a test case from NOAA which 
uses a pcolormesh draw function with basemap. 

Example 2: Plot data from an NWW3 GRiB2 file - [ here:  
http://polar.ncep.noaa.gov/waves/examples/usingpython.shtml]  

The following line is causing a Segmentation fault error even when adding 
an 8GB swap memory to the process: 

cs = m.pcolormesh(x,y,data,shading='flat',cmap=plt.cm.jet)

I also tryed to execute other, similar samples that use pcolormesh, but 
receiving the same error. Is this a known issue or might it be be related 
to the memory environment ? Any hints how to debug this error? 

Regards,

Claude Falbriard
Certified IT Specialist L2 - Middleware


Phone:55-13-99662-5703 | Mobile:55-13-98117-3316
E-mail: clau...@br.ibm.com



--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users






--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 1.5.1 - Function pcolormesh throws Segmentation Fault

2016-02-24 Thread Benjamin Root
Sorry, forgot to post the link: https://pypi.python.org/pypi/faulthandler/

On Wed, Feb 24, 2016 at 3:33 PM, Benjamin Root  wrote:

> Could you try using faulthandler and post the traceback please? That'll
> help us isolate the problem better.
>
> Ben Root
>
> On Wed, Feb 24, 2016 at 3:04 PM, Claude Falbriard 
> wrote:
>
>> Dear colleagues,
>>
>>  I've done a build from source of latest *Matplotlib* package and
>> deployed it at our IBM z13 machine (s390x). It uses the current release
>> 1.5.1.
>> During the unit tests I found an issue with a test case from NOAA which
>> uses a* pcolormesh* draw function with *basemap*.
>>
>> Example 2: Plot data from an NWW3 GRiB2 file - [ here:
>> *http://polar.ncep.noaa.gov/waves/examples/usingpython.shtml*
>> *]*
>>
>> The following line is causing a *Segmentation fault* error even when
>> adding an 8GB swap memory to the process:
>>
>> cs = m.pcolormesh(x,y,data,shading='flat',cmap=plt.cm.jet)
>>
>> I also tryed to execute other, similar samples that use pcolormesh, but
>> receiving the same error. Is this a known issue or might it be be related
>> to the memory environment ? Any hints how to debug this error?
>>
>> Regards,
>>
>> *Claude Falbriard*
>> Certified IT Specialist L2 - Middleware
>> --
>> *Phone:*55-13-99662-5703 | *Mobile:*55-13-98117-3316
>> *E-mail:* *clau...@br.ibm.com* 
>>
>>
>>
>> --
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Broken pipe error when saving animation for html5

2016-02-24 Thread Kyle Douglass
Hi all,
I would like to use matplotlib's animation API to create a movie that can
be embedded into an html5 video tag. To do this, I am following a couple
2012 blog posts from Jake VanderPlas:
http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/ and
http://jakevdp.github.io/blog/2013/05/12/embedding-matplotlib-animations/

My understanding is that I need to use the x264 codec to do this.
Unfortunately, I get a Broken Pipe Error when running the basic example
below. I get the same error when calling the animation.to_html5_video()
method.

Does anyone have an idea about why I'm getting the Broken Pipe error? Do I
really need the x264 codec to embed matplotlib animations into html? Thanks!

Kyle

*Example code:*

*import numpy as np*

*import matplotlib.pyplot as plt*

*from matplotlib import animate*
























*fig   = plt.figure()ax= plt.axes(xlim = (0, 2), ylim = (-2, 2))line, =
ax.plot([], [], linewidth = 2)# initialization function: plot the
background of each framedef init():line.set_data([], [])return
line,# animation function.  This is called sequentiallydef animate(i):x
= np.linspace(0, 2, 1000)y = np.sin(2 * np.pi * (x - 0.01 * i))
line.set_data(x, y)return line,# call the animatoranim =
animation.FuncAnimation(fig, animate,
init_func=init,   frames=200, interval=20,
blit=True)myWriter = animation.FFMpegWriter(fps = 30,
extra_args=['-vcodec', 'libx264'])anim.save('basic_animation.mp4', writer =
myWriter)*
*plt.show()*

*Traceback:*





















*Traceback (most recent call last):  File "test.py", line 26, in
anim.save('basic_animation.mp4', writer = myWriter)  File
"/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py",
line 810, in save
writer.grab_frame(**savefig_kwargs)  File
"/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/animation.py",
line 230, in grab_frame
dpi=self.dpi, **savefig_kwargs)  File
"/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/figure.py",
line 1565, in savefig
self.canvas.print_figure(*args, **kwargs)  File
"/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py",
line 196, in print_figure
FigureCanvasAgg.print_figure(self, *args, **kwargs)  File
"/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/backend_bases.py",
line 2232, in print_figure
**kwargs)  File
"/home/kmdouglass/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py",
line 519, in print_raw
fileobj.write(renderer._renderer.buffer_rgba())BrokenPipeError: [Errno 32]
Broken pipe*

I'm using Anaconda/Python 3.5 with matplotlib 1.5.1. I installed FFmpeg 3.0
in Debian Jessie by compiling FFmpeg from source into a dpkg according to
these instructions:
http://superuser.com/questions/286675/how-to-install-ffmpeg-on-debian I
also have Debian packages x264 and libx264-142 installed.
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 1.5.1 - Function pcolormesh throws Segmentation Fault

2016-02-24 Thread Benjamin Root
Could you try using faulthandler and post the traceback please? That'll
help us isolate the problem better.

Ben Root

On Wed, Feb 24, 2016 at 3:04 PM, Claude Falbriard 
wrote:

> Dear colleagues,
>
>  I've done a build from source of latest *Matplotlib* package and
> deployed it at our IBM z13 machine (s390x). It uses the current release
> 1.5.1.
> During the unit tests I found an issue with a test case from NOAA which
> uses a* pcolormesh* draw function with *basemap*.
>
> Example 2: Plot data from an NWW3 GRiB2 file - [ here:
> *http://polar.ncep.noaa.gov/waves/examples/usingpython.shtml*
> *]*
>
> The following line is causing a *Segmentation fault* error even when
> adding an 8GB swap memory to the process:
>
> cs = m.pcolormesh(x,y,data,shading='flat',cmap=plt.cm.jet)
>
> I also tryed to execute other, similar samples that use pcolormesh, but
> receiving the same error. Is this a known issue or might it be be related
> to the memory environment ? Any hints how to debug this error?
>
> Regards,
>
> *Claude Falbriard*
> Certified IT Specialist L2 - Middleware
> --
> *Phone:*55-13-99662-5703 | *Mobile:*55-13-98117-3316
> *E-mail:* *clau...@br.ibm.com* 
>
>
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Matplotlib 1.5.1 - Function pcolormesh throws Segmentation Fault

2016-02-24 Thread Claude Falbriard
Dear colleagues,

 I've done a build from source of latest Matplotlib package and deployed 
it at our IBM z13 machine (s390x). It uses the current release 1.5.1. 
During the unit tests I found an issue with a test case from NOAA which 
uses a pcolormesh draw function with basemap. 

Example 2: Plot data from an NWW3 GRiB2 file - [ here:  
http://polar.ncep.noaa.gov/waves/examples/usingpython.shtml ] 

The following line is causing a Segmentation fault error even when adding 
an 8GB swap memory to the process: 

cs = m.pcolormesh(x,y,data,shading='flat',cmap=plt.cm.jet)

I also tryed to execute other, similar samples that use pcolormesh, but 
receiving the same error. Is this a known issue or might it be be related 
to the memory environment ? Any hints how to debug this error? 


Regards,

Claude Falbriard
Certified IT Specialist L2 - Middleware


Phone: 55-13-99662-5703 | Mobile: 55-13-98117-3316
E-mail: clau...@br.ibm.com


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users