From tcaswell at gmail.com Thu Sep 1 13:21:20 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Thu, 01 Sep 2016 17:21:20 +0000 Subject: [Matplotlib-users] How can I speed up a tricontourf call ? In-Reply-To: References: Message-ID: If you have the RAM for it I would look at something like image pyramids https://en.wikipedia.org/wiki/Pyramid_(image_processing) + some LRU caching. Tom On Wed, Aug 31, 2016 at 1:08 PM Francis Chabouis wrote: > Hello, > I'm working on this travel times project : > > > https://ubikiwi.com/ouhabiter?locations=[[48.85522811385678,2.332191467285156]] > > and the contouring is done thanks to MPL tricontourf function (thanks!). > As you can see it works pretty well and is fast enough. > > As I'm trying to expand the geographical coverage of the application (the > whole country) I'm having performance issues with the contouring: > > - if I load the triangulation in memory at startup, it takes a huge amount > of RAM. But the real problem is that even a very small contour in this huge > triangulation takes a very long time to produce. For example with a small > triangulation, a 20 minutes walk isoline is instant. The same contour on a > country-wide triangulation takes 6sec. (It is not that long, but for a web > application it is). > > - If on the other hand I compute a triangulation for each request, the > contouring is fast but the triangulation creation is slow. > > Would someone have an optimisation idea ? > Is it somehow possible to speed up the triangulation ? > Any possible alternative ? > > Thanks a lot, > Francis > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Sep 5 14:28:38 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 05 Sep 2016 18:28:38 +0000 Subject: [Matplotlib-users] Documentation help request for web frameworks Message-ID: Folks, I know that there is a use of mpl as part of django / flask / bottle / zope / ... to write figures directly to buffers and serve them to users without writing to disk (an example of this is http://scipy-cookbook.readthedocs.io/items/Matplotlib_Django.html , but I think this is better done via `fig.savefig(bytes_io_buffer, format='png')` rather than reaching in and touching the canvas directly). This seems like the sort of thing that should be easy to find in our documentation. Is anyone interested in writing up 'canonical' examples? Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfoxrabinovitz at gmail.com Tue Sep 6 11:26:12 2016 From: jfoxrabinovitz at gmail.com (Joseph Fox-Rabinovitz) Date: Tue, 6 Sep 2016 11:26:12 -0400 Subject: [Matplotlib-users] Documentation help request for web frameworks In-Reply-To: References: Message-ID: I don't have the time to do a decent writeup of this, but here is a function that I use that does the byteio thing automatically. Perhaps it will be useful to someone who is willing to do the writeup. I trimmed out the domain-specific parts and left only the interesting bits: ``` def saveFigure(fig, file=None, **kwargs): """ Saves the figure as an image using `matplotlib.pyplot.savefig`. The main value of this method is that it automatically saves to memory via a `BytesIO` object if a file is not specified. fig: The figure to save file: Either a file name or file-like object, or `None`. In the former two cases, there is no return value. In the latter case, a `BytesIO` containing the image will be returned. The output will be rewound to the start in that case. The default is `None`. All other arguments are passed through directly to `savefig`. `format` defaults to 'png' if unset. Some common options include: """ output = BytesIO() if file is None else file kwargs.setdefault('format', 'png') fig.savefig(output, **kwargs) if file is None: output.seek(0) return output ``` On Mon, Sep 5, 2016 at 2:28 PM, Thomas Caswell wrote: > Folks, > > I know that there is a use of mpl as part of django / flask / bottle / > zope / ... to write figures directly to buffers and serve them to users > without writing to disk (an example of this is http://scipy-cookbook. > readthedocs.io/items/Matplotlib_Django.html , but I think this is better > done via `fig.savefig(bytes_io_buffer, format='png')` rather than reaching > in and touching the canvas directly). > > This seems like the sort of thing that should be easy to find in our > documentation. Is anyone interested in writing up 'canonical' examples? > > Tom > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dipugee at gmail.com Tue Sep 6 11:41:07 2016 From: dipugee at gmail.com (=?utf-8?Q?Dipankar_=E2=80=9CDipu=E2=80=9D_Ganguly?=) Date: Tue, 6 Sep 2016 08:41:07 -0700 Subject: [Matplotlib-users] Documentation help request for web frameworks In-Reply-To: References: Message-ID: <94BE9CDF-D887-4475-9E13-7F16CDC36974@gmail.com> Hi: I have a third party tool that allows me to create still frame ?.png? images (about 30-frames) ) from an ?.mpv? movie. I now need to read this series of 30 or so still frames into my IPython -based image processing environment automatically after being directed to the right source folder. Has someone already done something like this? I can currently read single frame images one at a time. I am not sure is if this is the right group to be posing the question to. If not I apologize and would appreciate being pointed to the right one. Thanks. Dipu Dipankar Ganguly Consultant: Strategy/Technology/Commercialization Bothell, WA Cell: 408-203-8814 email: dipugee at gmail.com http://www.linkedin.com/in/dipugee > On Sep 6, 2016, at 8:26 AM, Joseph Fox-Rabinovitz wrote: > > I don't have the time to do a decent writeup of this, but here is a function that I use that does the byteio thing automatically. Perhaps it will be useful to someone who is willing to do the writeup. I trimmed out the domain-specific parts and left only the interesting bits: > > ``` > def saveFigure(fig, file=None, **kwargs): > """ > Saves the figure as an image using `matplotlib.pyplot.savefig`. > > The main value of this method is that it automatically saves to memory via > a `BytesIO` object if a file is not specified. > > fig: The figure to save > file: Either a file name or file-like object, or `None`. In the former two > cases, there is no return value. In the latter case, a `BytesIO` > containing the image will be returned. The output will be rewound to > the start in that case. The default is `None`. > > All other arguments are passed through directly to `savefig`. `format` defaults > to 'png' if unset. Some common options include: > """ > output = BytesIO() if file is None else file > kwargs.setdefault('format', 'png') > fig.savefig(output, **kwargs) > if file is None: > output.seek(0) > return output > ``` > > On Mon, Sep 5, 2016 at 2:28 PM, Thomas Caswell > wrote: > Folks, > > I know that there is a use of mpl as part of django / flask / bottle / zope / ... to write figures directly to buffers and serve them to users without writing to disk (an example of this is http://scipy-cookbook.readthedocs.io/items/Matplotlib_Django.html , but I think this is better done via `fig.savefig(bytes_io_buffer, format='png')` rather than reaching in and touching the canvas directly). > > This seems like the sort of thing that should be easy to find in our documentation. Is anyone interested in writing up 'canonical' examples? > > Tom > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From John.Robson at usp.br Fri Sep 9 02:40:54 2016 From: John.Robson at usp.br (John Robson) Date: Fri, 9 Sep 2016 02:40:54 -0400 Subject: [Matplotlib-users] Simultaneous plots with Matplotlib "QObject/thread" error Message-ID: Hi all, I have some Flask pages that plot charts using Matplotlib, they work very well, but when running them simultaneously they break the site, with errors like: "QObject: Cannot create children for a parent that is in a different thread." "QObject::~QObject: Timers cannot be stopped from another thread" I wonder how to safely use Matplolib with Flask (with several simultaneous users plotting charts all the time)? Thank you, John From efiring at hawaii.edu Fri Sep 9 03:16:16 2016 From: efiring at hawaii.edu (Eric Firing) Date: Thu, 8 Sep 2016 21:16:16 -1000 Subject: [Matplotlib-users] Simultaneous plots with Matplotlib "QObject/thread" error In-Reply-To: References: Message-ID: <7ded027d-65fc-c656-3194-c37ed3435b1d@hawaii.edu> On 2016/09/08 8:40 PM, John Robson wrote: > Hi all, > > I have some Flask pages that plot charts using Matplotlib, they work > very well, but when running them simultaneously they break the site, > with errors like: > > "QObject: Cannot create children for a parent that is in a different > thread." > > "QObject::~QObject: Timers cannot be stopped from another thread" > > I wonder how to safely use Matplolib with Flask (with several > simultaneous users plotting charts all the time)? I suspect the problem is that matplotlib is running with the qt4agg backend. When plotting for a web app like that, you need to make sure the backend is set to the agg backend. You can do that in a matplotlibrc file or directly in the plotting script, immediately after importing matplotlib and before importing pyplot (if you use pyplot at all). Eric > > Thank you, > John From John.Robson at usp.br Fri Sep 9 17:24:08 2016 From: John.Robson at usp.br (John Robson) Date: Fri, 9 Sep 2016 17:24:08 -0400 Subject: [Matplotlib-users] Simultaneous plots with Matplotlib "QObject/thread" error In-Reply-To: <7ded027d-65fc-c656-3194-c37ed3435b1d@hawaii.edu> References: <7ded027d-65fc-c656-3194-c37ed3435b1d@hawaii.edu> Message-ID: Eric, you are right, I followed this and worked: http://matplotlib.org/faq/howto_faq.html#howto-webapp I also fixed other problems, I was using "plt.savefig", "plt.xxx" I believe that this "plt" was harming other simultaneous plots, so I replaced every "plt." by ".fig" and now I think is OK. I just wonder how can I isolate each plot from other simultaneous plots, I'm doing this: fig = plt.figure() ax = fig.gca() > plot stuff, scatterplot, etc..., set title, lables, etc... fig = ax.get_figure() fig.set_tight_layout(True) fig.savefig(filename, format='png', dpi=100, facecolor='w', edgecolor='k', bbox_inches='tight') fig.clf() plt.close(fig) So the first "fig" instance is destroyed at the end and there is no "plt.xxx" This is a good approach to isolate all plots? Thank you, John On 09/09/16 03:16, Eric Firing wrote: > On 2016/09/08 8:40 PM, John Robson wrote: >> Hi all, >> >> I have some Flask pages that plot charts using Matplotlib, they work >> very well, but when running them simultaneously they break the site, >> with errors like: >> >> "QObject: Cannot create children for a parent that is in a different >> thread." >> >> "QObject::~QObject: Timers cannot be stopped from another thread" >> >> I wonder how to safely use Matplolib with Flask (with several >> simultaneous users plotting charts all the time)? > > I suspect the problem is that matplotlib is running with the qt4agg > backend. > > When plotting for a web app like that, you need to make sure the backend > is set to the agg backend. You can do that in a matplotlibrc file or > directly in the plotting script, immediately after importing matplotlib > and before importing pyplot (if you use pyplot at all). > > Eric > >> >> Thank you, >> John From efiring at hawaii.edu Fri Sep 9 17:58:05 2016 From: efiring at hawaii.edu (Eric Firing) Date: Fri, 9 Sep 2016 11:58:05 -1000 Subject: [Matplotlib-users] Simultaneous plots with Matplotlib "QObject/thread" error In-Reply-To: References: <7ded027d-65fc-c656-3194-c37ed3435b1d@hawaii.edu> Message-ID: <6f979b1c-5c12-4ff8-68c2-aab76e05f3b2@hawaii.edu> John, Your new approach looks good to me, but could be tweaked. You don't need the 'fig.clf()' at the end because the 'plt.close(fig)' will take care of cleaning everything up. At the start, using 'fig.gca()' seems a little odd. A common and compact idiom now would be 'fig, ax = plt.subplots()'. Once you have the figure reference, you don't need to recreate it with the call to 'ax.get_figure()`, so you can delete that. I don't think you need both tight_layout and bbox_inches='tight'. My impression is that the latter is more robust, but has the possible disadvantage of modifying the figure dimensions, which might be undesirable in a web app. Eric On 2016/09/09 11:24 AM, John Robson wrote: > Eric, you are right, I followed this and worked: > > http://matplotlib.org/faq/howto_faq.html#howto-webapp > > I also fixed other problems, I was using "plt.savefig", "plt.xxx" I > believe that this "plt" was harming other simultaneous plots, so I > replaced every "plt." by ".fig" and now I think is OK. > > I just wonder how can I isolate each plot from other simultaneous plots, > I'm doing this: > > fig = plt.figure() > ax = fig.gca() >> plot stuff, scatterplot, etc..., set title, lables, etc... > fig = ax.get_figure() > fig.set_tight_layout(True) > fig.savefig(filename, format='png', dpi=100, facecolor='w', > edgecolor='k', bbox_inches='tight') > fig.clf() > plt.close(fig) > > So the first "fig" instance is destroyed at the end and there is no > "plt.xxx" > > This is a good approach to isolate all plots? > > Thank you, > John > > > > On 09/09/16 03:16, Eric Firing wrote: >> On 2016/09/08 8:40 PM, John Robson wrote: >>> Hi all, >>> >>> I have some Flask pages that plot charts using Matplotlib, they work >>> very well, but when running them simultaneously they break the site, >>> with errors like: >>> >>> "QObject: Cannot create children for a parent that is in a different >>> thread." >>> >>> "QObject::~QObject: Timers cannot be stopped from another thread" >>> >>> I wonder how to safely use Matplolib with Flask (with several >>> simultaneous users plotting charts all the time)? >> >> I suspect the problem is that matplotlib is running with the qt4agg >> backend. >> >> When plotting for a web app like that, you need to make sure the backend >> is set to the agg backend. You can do that in a matplotlibrc file or >> directly in the plotting script, immediately after importing matplotlib >> and before importing pyplot (if you use pyplot at all). >> >> Eric >> >>> >>> Thank you, >>> John > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From John.Robson at usp.br Fri Sep 9 20:31:40 2016 From: John.Robson at usp.br (John Robson) Date: Fri, 9 Sep 2016 20:31:40 -0400 Subject: [Matplotlib-users] Simultaneous plots with Matplotlib "QObject/thread" error In-Reply-To: <6f979b1c-5c12-4ff8-68c2-aab76e05f3b2@hawaii.edu> References: <7ded027d-65fc-c656-3194-c37ed3435b1d@hawaii.edu> <6f979b1c-5c12-4ff8-68c2-aab76e05f3b2@hawaii.edu> Message-ID: I implemented what you suggested; I hope do not have problems with lack of isolation when plot several figures at the same time, thank you. Btw, for a better management of several simultaneous plots, what do you recommend: a task queue like Celery? something else? Tks John From efiring at hawaii.edu Fri Sep 9 20:44:20 2016 From: efiring at hawaii.edu (Eric Firing) Date: Fri, 9 Sep 2016 14:44:20 -1000 Subject: [Matplotlib-users] Simultaneous plots with Matplotlib "QObject/thread" error In-Reply-To: References: <7ded027d-65fc-c656-3194-c37ed3435b1d@hawaii.edu> <6f979b1c-5c12-4ff8-68c2-aab76e05f3b2@hawaii.edu> Message-ID: <8352226b-a27f-c9b5-7ab0-c91325c3d58c@hawaii.edu> On 2016/09/09 2:31 PM, John Robson wrote: > Btw, for a better management of several simultaneous plots, what do you > recommend: a task queue like Celery? something else? John, I don't have a clear picture of your situation, and I've never heard of Celery before. Maybe someone else on this list will be better qualified to answer. Eric From ianthomas23 at gmail.com Thu Sep 15 03:46:14 2016 From: ianthomas23 at gmail.com (Ian Thomas) Date: Thu, 15 Sep 2016 08:46:14 +0100 Subject: [Matplotlib-users] How can I speed up a tricontourf call ? In-Reply-To: References: Message-ID: Hello Francis, Normally to help with requests of this nature we would need to see your code to identify if you are doing anything wrong, or at least sub-optimally. Without seeing your code, we will at least need some more information. We'll start with: 1) How big is your triangulation, i.e. how many points and how many triangles? 2) How much is "a huge amount of RAM"? 3) How long is a "very long time to produce"? 4) How much RAM do you have available? 5) Is the geometric triangulation static, i.e. constant in time? 6) Each time you create a matplotlib.tri.Triangulation object, do you specify the triangles array or not (the latter meaning that a Delaunay triangulation is calculated for you)? Ian On 31 August 2016 at 18:08, Francis Chabouis wrote: > Hello, > I'm working on this travel times project : > > https://ubikiwi.com/ouhabiter?locations=[[48.85522811385678, > 2.332191467285156]] > > and the contouring is done thanks to MPL tricontourf function (thanks!). > As you can see it works pretty well and is fast enough. > > As I'm trying to expand the geographical coverage of the application (the > whole country) I'm having performance issues with the contouring: > > - if I load the triangulation in memory at startup, it takes a huge amount > of RAM. But the real problem is that even a very small contour in this huge > triangulation takes a very long time to produce. For example with a small > triangulation, a 20 minutes walk isoline is instant. The same contour on a > country-wide triangulation takes 6sec. (It is not that long, but for a web > application it is). > > - If on the other hand I compute a triangulation for each request, the > contouring is fast but the triangulation creation is slow. > > Would someone have an optimisation idea ? > Is it somehow possible to speed up the triangulation ? > Any possible alternative ? > > Thanks a lot, > Francis > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thierry.jolicoeur at u-psud.fr Wed Sep 21 05:54:43 2016 From: thierry.jolicoeur at u-psud.fr (Thierry) Date: Wed, 21 Sep 2016 02:54:43 -0700 (MST) Subject: [Matplotlib-users] matplotlib: no output with Agg - TkAgg - Qt5Agg -- stuck at ttconv.so Message-ID: <1474451683789-47535.post@n5.nabble.com> Hello, I use python/matplotlib scripts regularly to produce nice figures from raw data files. After the summer break I did an update of my Gentoo box and I have now a problem with matplotlib. It produces no graphical output: no pop-up window with a graph and no way to save a plot. I have tried to change the backend : with TkAgg or Qt5Agg the process is stuck forever and to be killed manually kill -9, with Agg it is slightly better, I get back the command line but the pdf file created is not complete, unreadable by Okular. here are the versions: so it's gentoo box kernek is 3.10.17 python 2.7.10 dev-python/matplotlib-1.5.3 I use also ipython-5.1.0 which shows the same problem. I tried the new jupyter qtconsole which hangs when displaying a plot. I ran a minimal script that contains the problem: ************************************* from pylab import * x=[1.,2.,3.] y=[2.,3.,4.] plot(x,y,'o') savefig('myf.pdf',format='pdf') ************************************* the same behavior arises in interactive shell, calling directly matplotlib directly instead of pylab. running the script with python -v my_script.py gives a very verbose output whose end is: .... import matplotlib.backends.qt_editor.formsubplottool # precompiled from /usr/lib64/python2.7/site-packages/matplotlib/backends/qt_editor/formsubplottool.pyc # /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.pyc matches /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.py import matplotlib.backends.backend_pdf # precompiled from /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.pyc # /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_mixed.pyc matches /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_mixed.py import matplotlib.backends.backend_mixed # precompiled from /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_mixed.pyc # /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyc matches /usr/lib64/python2.7/site-packages/matplotlib/type1font.py import matplotlib.type1font # precompiled from /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyc dlopen("/usr/lib64/python2.7/site-packages/matplotlib/ttconv.so", 2); import matplotlib.ttconv # dynamically loaded from /usr/lib64/python2.7/site-packages/matplotlib/ttconv.so it dies right at ttconv.so the process is then should be killed with -9 Looking for ttconv.so seems OK ... tjoli at skynet matplotlib % file ttconv.so ttconv.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, stripped tjoli at skynet matplotlib % ldd ttconv.so linux-vdso.so.1 (0x00007fffe9b1f000) libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6 (0x00007f85f6445000) libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007f85f6076000) libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1 (0x00007f85f5e5f000) libc.so.6 => /lib64/libc.so.6 (0x00007f85f5ac3000) libm.so.6 => /lib64/libm.so.6 (0x00007f85f57c4000) /lib64/ld-linux-x86-64.so.2 (0x00007f85f6a0c000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f85f55a8000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f85f53a4000) libutil.so.1 => /lib64/libutil.so.1 (0x00007f85f51a0000) If I use Agg then the end of the output with '-v' is the same but I get back the command line. No appearance of the usual cleanup messages that appear after a successful run. Any ideas would be welcome thanks in advance. (In case it is gentoo-specific I posted this problem on the gentoo forum - no answers yet.) -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlib-no-output-with-Agg-TkAgg-Qt5Agg-stuck-at-ttconv-so-tp47535.html Sent from the matplotlib - users mailing list archive at Nabble.com. From tcaswell at gmail.com Wed Sep 21 17:04:01 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 21 Sep 2016 21:04:01 +0000 Subject: [Matplotlib-users] NumFOCUS Projects Director Message-ID: Forwarded on on behalf of NumFOCUS. Please distribute this through your networks! NumFOCUS is seeking to hire a full-time Projects Director to develop and run a sustainability incubator program for NumFOCUS fiscally sponsored open source projects. This is the first program of its kind, with opportunity for enormous impact on the open source ecosystem. The Projects Director will work with NumFOCUS fiscally sponsored Open Source projects to develop appropriate business development strategies and opportunities to engage with industry. The learnings from this program will be public, meaning it has the potential to change how all open source projects are managed. NumFOCUS is 501(c)3 whose mission is to promote sustainable high-level programming languages, open code development, and reproducible scientific research. They accomplish this mission through their educational programs and events as well as through fiscal sponsorship of open source data science projects. They aim to increase collaboration and communication within the scientific computing community. The Projects Director position is initially funded for 2 years through a grant from the Sloan Foundation. The incumbent will be hired as an employee of NumFOCUS. Review of applications will begin October 10th, and the position will remain open until filled. Job description The Projects Director will lead efforts to identify skills and perspectives that Open Source Project leads need to establish sustainability models and seek opportunities for funding and will consult with NumFOCUS projects and disseminate outcomes. Responsibilities Include: - Organize a ?business bootcamp? workshop, coach project leads and lead an Advisory Board for these business development efforts - Develop business and financial plans, improve communication, build industry relationships, and broadly develop strategies for fostering these relationships. - Lead efforts to identify skills and perspectives that Open Source Project leads need to establish sustainability models and seek opportunities for funding - Using materials from workshops and other resources, develop and disseminate an Open Source Nurturing and Actionable Practices Kit (OSNAP Kit) to provide guidance to open source projects outside of NumFOCUS - Establish assessment strategies to measure impact and help NumFOCUS open-source projects develop industry relationships Qualifications As this role provides a business, operations and marketing perspective to Open Source project leads, the candidate should have: - Preferred: 4 years experience in business development, operations and/or marketing - Strong oral and written communication skills - Teaching experience of some capacity, e.g. teaching at universities or creating and running workshops - Demonstrated ability to interact with a broad range of people from technical leads to industry leaders - Experience working with open communities, e.g. open source software, hardware or makers, - A rich network of experts in business and technology to draw ideas and collaboration from. Salary NumFOCUS offers a competitive salary commensurate with experience and a comprehensive benefits package. Applications To apply, please submit your resume/CV and cover letter (up to two pages) to NumFOCUS at: projects_director at numfocus.org See the posting at: http://www.numfocus.org/blog/projects-director-job-posting -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Thu Sep 22 15:41:43 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Thu, 22 Sep 2016 15:41:43 -0400 Subject: [Matplotlib-users] matplotlib: no output with Agg - TkAgg - Qt5Agg -- stuck at ttconv.so In-Reply-To: <1474451683789-47535.post@n5.nabble.com> References: <1474451683789-47535.post@n5.nabble.com> Message-ID: The ttconv.so stuff has to do with font handling. Since it is happening with all backends, I suspect that the problem is with the font-cache build, which is done at the first import of matplotlib (or when the cache needs updating) -- regardless of the selected backend. I would try a completely clean rebuild of matplotlib (just nuke it from orbit), and capture the build logs in case there are some notes/warnings in it regarding linking to freetype. Cheers! Ben Root On Wed, Sep 21, 2016 at 5:54 AM, Thierry wrote: > Hello, > > I use python/matplotlib scripts regularly to produce nice figures from raw > data files. After the summer break I did an update of my Gentoo box and I > have > now a problem with matplotlib. It produces no graphical output: no pop-up > window with a graph and no way to save a plot. I have tried to change > the backend : with TkAgg or Qt5Agg the process is stuck forever > and to be killed manually kill -9, with Agg it is slightly better, I get > back the command line > but the pdf file created is not complete, unreadable by Okular. > > here are the versions: > > so it's gentoo box > kernek is 3.10.17 > python 2.7.10 > dev-python/matplotlib-1.5.3 > > I use also ipython-5.1.0 which shows the same problem. > I tried the new jupyter qtconsole which hangs when displaying a plot. > > I ran a minimal script that contains the problem: > > ************************************* > from pylab import * > x=[1.,2.,3.] > y=[2.,3.,4.] > plot(x,y,'o') > savefig('myf.pdf',format='pdf') > ************************************* > > > the same behavior arises in interactive shell, calling directly matplotlib > directly > instead of pylab. > > running the script with python -v my_script.py > gives a very verbose output whose end is: > > .... > import matplotlib.backends.qt_editor.formsubplottool # precompiled from > /usr/lib64/python2.7/site-packages/matplotlib/backends/ > qt_editor/formsubplottool.pyc > # /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.pyc > matches > /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.py > import matplotlib.backends.backend_pdf # precompiled from > /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.pyc > # /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_mixed.pyc > matches > /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_mixed.py > import matplotlib.backends.backend_mixed # precompiled from > /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_mixed.pyc > # /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyc matches > /usr/lib64/python2.7/site-packages/matplotlib/type1font.py > import matplotlib.type1font # precompiled from > /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyc > dlopen("/usr/lib64/python2.7/site-packages/matplotlib/ttconv.so", 2); > import matplotlib.ttconv # dynamically loaded from > /usr/lib64/python2.7/site-packages/matplotlib/ttconv.so > > > it dies right at ttconv.so > the process is then > should be killed with -9 > > > Looking for ttconv.so seems OK ... > > tjoli at skynet matplotlib % file ttconv.so > ttconv.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), > dynamically linked, stripped > > tjoli at skynet matplotlib % ldd ttconv.so > linux-vdso.so.1 (0x00007fffe9b1f000) > libstdc++.so.6 => > /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6 (0x00007f85f6445000) > libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 > (0x00007f85f6076000) > libgcc_s.so.1 => > /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1 (0x00007f85f5e5f000) > libc.so.6 => /lib64/libc.so.6 (0x00007f85f5ac3000) > libm.so.6 => /lib64/libm.so.6 (0x00007f85f57c4000) > /lib64/ld-linux-x86-64.so.2 (0x00007f85f6a0c000) > libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f85f55a8000) > libdl.so.2 => /lib64/libdl.so.2 (0x00007f85f53a4000) > libutil.so.1 => /lib64/libutil.so.1 (0x00007f85f51a0000) > > > If I use Agg then the end of the output with '-v' is the same but I get > back > the command line. > No appearance of the usual cleanup messages that appear after a successful > run. > > > Any ideas would be welcome > thanks in advance. > (In case it is gentoo-specific I posted this problem on the gentoo forum - > no answers yet.) > > > > > > > -- > View this message in context: http://matplotlib.1069221.n5. > nabble.com/matplotlib-no-output-with-Agg-TkAgg-Qt5Agg- > stuck-at-ttconv-so-tp47535.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglists at xgm.de Fri Sep 23 05:08:45 2016 From: mailinglists at xgm.de (Florian Lindner) Date: Fri, 23 Sep 2016 11:08:45 +0200 Subject: [Matplotlib-users] Plotting and formatting dates Message-ID: Hello, I have read data with dates using numpy.genfromtxt. The resulting data format is ['datetime64[D]', np.float32, np.float32]}. Plotting the data works perfect: dates = finances["Date"] bar = np.cumsum(finances["Bar"]) giro = np.cumsum(finances["Giro"]) total = bar + giro fig, ax = plt.subplots() ax.plot(dates, bar, "-d", label = "Bar") ax.plot(dates, giro, "-d", label = "Giro") ax.plot(dates, total, "-D", label = "Gesamt", linewidth=3) but using a date formatting for the x-axis and a currency format for y-axis does not work: def formatCurrency(x): return '%1.2f ?' % x locator = matplotlib.dates.AutoDateLocator() ax.xaxis.set_major_locator(locator) ax.format_xdata = matplotlib.dates.AutoDateFormatter(locator) ax.format_ydata = formatCurrency fig.autofmt_xdate() ax.grid() ax.legend() plt.show() It simply shows no effect, no ? sign at y-data, the x-data is still an int-like number. What am I doing wrong? Thanks, Florian From thierry.jolicoeur at u-psud.fr Fri Sep 23 05:38:21 2016 From: thierry.jolicoeur at u-psud.fr (Thierry) Date: Fri, 23 Sep 2016 02:38:21 -0700 (MST) Subject: [Matplotlib-users] matplotlib: no output with Agg - TkAgg - Qt5Agg -- stuck at ttconv.so In-Reply-To: References: <1474451683789-47535.post@n5.nabble.com> Message-ID: <1474623501586-47541.post@n5.nabble.com> after a complete rebuild the situation is basically unchanged... there is no complaint about freetype in the build log and the typical outcome here the default backend is Qt5Agg - this is the first wake-up of newborn matplotlib: tjoli at skynet ~ % python Python 2.7.10 (default, Nov 19 2015, 13:26:08) [GCC 4.9.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pylab import * /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') >>> x=[1.,2.,3.] >>> y=[2.,3.,4.] >>> plot(x,y,'o') [] >>> show() Qt has caught an exception thrown from an event handler. Throwing exceptions from an event handler is not supported in Qt. You must reimplement QApplication::notify() and catch all exceptions there. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlib-no-output-with-Agg-TkAgg-Qt5Agg-stuck-at-ttconv-so-tp47535p47541.html Sent from the matplotlib - users mailing list archive at Nabble.com. From thierry.jolicoeur at u-psud.fr Fri Sep 23 06:06:57 2016 From: thierry.jolicoeur at u-psud.fr (Thierry) Date: Fri, 23 Sep 2016 03:06:57 -0700 (MST) Subject: [Matplotlib-users] matplotlib: no output with Agg - TkAgg - Qt5Agg -- stuck at ttconv.so In-Reply-To: <1474623501586-47541.post@n5.nabble.com> References: <1474451683789-47535.post@n5.nabble.com> <1474623501586-47541.post@n5.nabble.com> Message-ID: <1474625217889-47542.post@n5.nabble.com> I ran a small script to check fonts: from matplotlib.font_manager import FontProperties, findfont fp = FontProperties(family='monospace', style='normal', variant='normal', weight='normal', stretch='normal', size='medium') font = findfont(fp) doing python my_script.py --verbose-debug leads to: tjoli at skynet Desktop % python fonts.py --verbose-debug $HOME=/home/tjoli matplotlib data path /usr/lib64/python2.7/site-packages/matplotlib/mpl-data ***************************************************************** You have the following UNSUPPORTED LaTeX preamble customizations: Please do not ask for support with these customizations active. ***************************************************************** loaded rc file /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 1.5.3 verbose.level debug interactive is False platform is linux2 loaded modules: CACHEDIR=/home/tjoli/.cache/matplotlib Using fontManager instance from /home/tjoli/.cache/matplotlib/fontList.cache findfont: Matching :family=monospace:style=normal:variant=normal:weight=400:stretch=normal:size=medium to Bitstream Vera Sans Mono (u'/usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/VeraMono.ttf') with score of 0.000000 tjoli at skynet Desktop % ls /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf COPYRIGHT.TXT STIXNonUni.ttf STIXSizOneSymReg.ttf VeraIt.ttf cmex10.ttf LICENSE_STIX STIXNonUniBol.ttf STIXSizThreeSymBol.ttf VeraMoBI.ttf cmmi10.ttf README.TXT STIXNonUniBolIta.ttf STIXSizThreeSymReg.ttf VeraMoBd.ttf cmr10.ttf RELEASENOTES.TXT STIXNonUniIta.ttf STIXSizTwoSymBol.ttf VeraMoIt.ttf cmss10.ttf STIXGeneral.ttf STIXSizFiveSymReg.ttf STIXSizTwoSymReg.ttf VeraMono.ttf cmsy10.ttf STIXGeneralBol.ttf STIXSizFourSymBol.ttf Vera.ttf VeraSe.ttf cmtt10.ttf STIXGeneralBolIta.ttf STIXSizFourSymReg.ttf VeraBI.ttf VeraSeBd.ttf STIXGeneralItalic.ttf STIXSizOneSymBol.ttf VeraBd.ttf cmb10.ttf tjoli at skynet Desktop % so the fallback VeraSans are taken into account -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlib-no-output-with-Agg-TkAgg-Qt5Agg-stuck-at-ttconv-so-tp47535p47542.html Sent from the matplotlib - users mailing list archive at Nabble.com. From ben.v.root at gmail.com Fri Sep 23 09:17:02 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 23 Sep 2016 09:17:02 -0400 Subject: [Matplotlib-users] matplotlib: no output with Agg - TkAgg - Qt5Agg -- stuck at ttconv.so In-Reply-To: <1474625217889-47542.post@n5.nabble.com> References: <1474451683789-47535.post@n5.nabble.com> <1474623501586-47541.post@n5.nabble.com> <1474625217889-47542.post@n5.nabble.com> Message-ID: The error for Qt5 is a bug that has very recently been fixed. I am pretty sure it is in v1.5.3. (Well... not exactly fixed, more that it won't crash the interpreter). It does seem like you are making it further than you were before. It would be good to see the traceback from the Qt5 failure, and to know which version of matplotlib you are using. On Fri, Sep 23, 2016 at 6:06 AM, Thierry wrote: > I ran a small script to check fonts: > > from matplotlib.font_manager import FontProperties, findfont > fp = FontProperties(family='monospace', > style='normal', > variant='normal', > weight='normal', > stretch='normal', > size='medium') > > font = findfont(fp) > > doing python my_script.py --verbose-debug leads to: > > tjoli at skynet Desktop % python fonts.py --verbose-debug > $HOME=/home/tjoli > matplotlib data path /usr/lib64/python2.7/site- > packages/matplotlib/mpl-data > > ***************************************************************** > You have the following UNSUPPORTED LaTeX preamble customizations: > > Please do not ask for support with these customizations active. > ***************************************************************** > > loaded rc file > /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc > matplotlib version 1.5.3 > verbose.level debug > interactive is False > platform is linux2 > loaded modules: > CACHEDIR=/home/tjoli/.cache/matplotlib > Using fontManager instance from /home/tjoli/.cache/matplotlib/ > fontList.cache > findfont: Matching > :family=monospace:style=normal:variant=normal:weight= > 400:stretch=normal:size=medium > to Bitstream Vera Sans Mono > (u'/usr/lib64/python2.7/site-packages/matplotlib/mpl-data/ > fonts/ttf/VeraMono.ttf') > with score of 0.000000 > tjoli at skynet Desktop % ls > /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf > COPYRIGHT.TXT STIXNonUni.ttf STIXSizOneSymReg.ttf > VeraIt.ttf cmex10.ttf > LICENSE_STIX STIXNonUniBol.ttf STIXSizThreeSymBol.ttf > VeraMoBI.ttf cmmi10.ttf > README.TXT STIXNonUniBolIta.ttf STIXSizThreeSymReg.ttf > VeraMoBd.ttf cmr10.ttf > RELEASENOTES.TXT STIXNonUniIta.ttf STIXSizTwoSymBol.ttf > VeraMoIt.ttf cmss10.ttf > STIXGeneral.ttf STIXSizFiveSymReg.ttf STIXSizTwoSymReg.ttf > VeraMono.ttf cmsy10.ttf > STIXGeneralBol.ttf STIXSizFourSymBol.ttf Vera.ttf > VeraSe.ttf cmtt10.ttf > STIXGeneralBolIta.ttf STIXSizFourSymReg.ttf VeraBI.ttf > VeraSeBd.ttf > STIXGeneralItalic.ttf STIXSizOneSymBol.ttf VeraBd.ttf > cmb10.ttf > tjoli at skynet Desktop % > > so the fallback VeraSans are taken into account > > > > > > > -- > View this message in context: http://matplotlib.1069221.n5. > nabble.com/matplotlib-no-output-with-Agg-TkAgg-Qt5Agg-stuck-at-ttconv-so- > tp47535p47542.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thierry.jolicoeur at u-psud.fr Fri Sep 23 09:28:13 2016 From: thierry.jolicoeur at u-psud.fr (Thierry) Date: Fri, 23 Sep 2016 06:28:13 -0700 (MST) Subject: [Matplotlib-users] matplotlib: no output with Agg - TkAgg - Qt5Agg -- stuck at ttconv.so In-Reply-To: References: <1474451683789-47535.post@n5.nabble.com> <1474623501586-47541.post@n5.nabble.com> <1474625217889-47542.post@n5.nabble.com> Message-ID: <1474637293236-47544.post@n5.nabble.com> This is matplotlib 1.5.3 / python 2.7.10 if I use the Tk backend then the plot window appear but nothing in it and the process is stuck. So not sure it has to do with Qt5 I don't see how to get a traceback for such graphical troubles. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlib-no-output-with-Agg-TkAgg-Qt5Agg-stuck-at-ttconv-so-tp47535p47544.html Sent from the matplotlib - users mailing list archive at Nabble.com. From xavier.gnata at gmail.com Mon Sep 26 15:39:09 2016 From: xavier.gnata at gmail.com (Xavier Gnata) Date: Mon, 26 Sep 2016 21:39:09 +0200 Subject: [Matplotlib-users] How to blur "add_patch(Rectangle(..." Message-ID: <2fe8e9f1-5b1d-40e9-c794-a2211880f301@gmail.com> Hello, The code in attachment produces a checkerboard pattern made of rectangles. How could I blur only some of these Rectangle? Is it possible to add a filter on top of a currentAxis.add_patch(Rectangle( ... ? Xavier -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fm.py Type: text/x-python Size: 625 bytes Desc: not available URL: From christian at fredborg-braedstrup.dk Wed Sep 28 09:41:39 2016 From: christian at fredborg-braedstrup.dk (christian at fredborg-braedstrup.dk) Date: Wed, 28 Sep 2016 15:41:39 +0200 Subject: [Matplotlib-users] Advanced usage of custom hatch with fill_between Message-ID: <1475070099.2464535.739650417.79E587CE@webmail.messagingengine.com> Hi, I would like to make some quite advanced custom hatches and can't figure out the best way to do it in matplotlib. I am not even sure hatches are the best way too go about it. Have considered using a png or similar and overlay that on the image. But I would like to use the fill_between command and that does not support using pngs in that way. Here is a example of what I would like my hatch to look like, http://fredborg-braedstrup.dk/hatch_examples.png This stack overflow question got me a bit of the way: http://stackoverflow.com/questions/17285154/how-to-fill-a-polygon-with-a-custom-hatch-in-matplotlib I have therefore made a polygon to draw the "T" like symbol on a unit rectangle, T_path = Polygon( [[0.0, -0.2], [0.0, 0.0], [-0.4, 0.0], [0.4, 0.0], [0.0, 0.0], [0.0, -0.4]], closed=True, fill=False).get_path() but the symbols are too small and closely spaced. I have a example here, http://fredborg-braedstrup.dk/hatch_mpl_example.png Is it possible to enlarge the individual symbols (T's) without having them clip on the unit rectangle? Or perhaps it is possible to only plot every 5th symbol? It seems quite easy when creating hatch lines and adding space but I have not found a good solution for general polygons yet. If a solution exists without using hatches I am all open to that. Hope someone can point me in the right direction on this. Thanks, Christian From efiring at hawaii.edu Fri Sep 30 22:51:18 2016 From: efiring at hawaii.edu (Eric Firing) Date: Fri, 30 Sep 2016 16:51:18 -1000 Subject: [Matplotlib-users] encoders for animations Message-ID: <94e0e688-44a8-6132-c662-6bada1c842d6@hawaii.edu> For making video files the animation module presently supports ffmpeg (the default), avconv (a fork of ffmpeg), and mencoder. Does anyone use mencoder? If so, why? And would you be seriously inconvenienced or otherwise harmed if we ended our only partially successful support of mencoder as an option in the animation module? Thank you. Eric