[Matplotlib-users] Best way to display image from URL in Python3
Hello all, I'm porting over some code that used Py2.7 urllib2.urlopen(url) to grab some image data from the net and load with pyplot.imread. It doesn't work quite right in Py3.4. I found a couple of refs: https://github.com/matplotlib/matplotlib/pull/1650 http://stackoverflow.com/questions/15183170/python-crash-when-downloading-image-as-numpy-array They suggest io.BytesIO(urllib.request.urlopen(url).read()) as a replacement for Py3. Is this the best practice? Does anyone know a simpler way to do this? Ryan -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] segmentation fault when saving images
well, that still doesn't explain the segfaults. NaNs shouldn't cause matplotlib to crash upon saving. I would still be interested in a stacktrace. Ben On Thu, Mar 19, 2015 at 1:27 PM, Gabriele Brambilla < gb.gabrielebrambi...@gmail.com> wrote: > Actually Paul Hobson was right. > > Now it works. > > Thanks > > Gabriele > > On Thu, Mar 19, 2015 at 1:19 PM, Benjamin Root wrote: > >> The warnings probably have nothing to do with the issue at hand. Try >> this. Install the package "faulthandler" and add the appropriate lines to >> your Bdipoly.py script and run it again. That way, we can get a traceback >> and find out where it is segfaulting from. >> >> http://faulthandler.readthedocs.org/en/latest/ >> >> Ben Root >> >> As a side-note: faulthandler is part of the standard library as of 3.3! >> Neat! >> >> >> On Thu, Mar 19, 2015 at 1:13 PM, Gabriele Brambilla < >> gb.gabrielebrambi...@gmail.com> wrote: >> >>> Hi guys, >>> >>> I don't understand why now, after I save an image when it is prompted >>> out, the image is not saved and it closes automatically and on the terminal >>> appears segmentation fault. >>> >>> this is what my terminal shows: >>> >>> [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py >>> >>> Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide >>> >>> lwb = 5/(np.log10(modB.max()/modB)) >>> >>> Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide >>> >>> lwe = 5/(np.log10(modE.max()/modE)) >>> >>> Segmentation fault >>> >>> >>> Thanks >>> >>> >>> Gabriele >>> >>> >>> >>> >>> >>> -- >>> Dive into the World of Parallel Programming The Go Parallel Website, >>> sponsored >>> by Intel and developed in partnership with Slashdot Media, is your hub >>> for all >>> things parallel software development, from weekly thought leadership >>> blogs to >>> news, videos, case studies, tutorials and more. Take a look and join the >>> conversation now. http://goparallel.sourceforge.net/ >>> ___ >>> Matplotlib-users mailing list >>> Matplotlib-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] ANN: HoloViews 1.0 released
We are pleased to announce the first public release of HoloViews, a Python package for scientific and engineering data visualization: http://ioam.github.io/holoviews HoloViews provides composable, sliceable, declarative data structures for building even complex visualizations easily. It's designed to exploit the rich ecosystem of scientific Python tools already available, using Numpy for data storage, matplotlib and mpld3 as plotting backends, and integrating fully with IPython Notebook to make your data instantly visible. If you look at the website for just about any other visualization package, you'll see a long list of pretty pictures, each one of which has a page or two of code putting it together. There are pretty pictures in HoloViews too, but there is *no* hidden code -- *all* of the steps needed to build a given figure are shown right before the HoloViews plot, with just a few lines needed for nearly all of our examples, even complex multi-figure subplots and animations. This concise but flexible specification makes it practical to explore and analyze your data interactively, while leaving a full record for later reproducibility in the notebook. It may sound like magic, but it's not -- HoloViews simply lets you annotate your data with appropriate metadata, and then the data can display itself! HoloViews provides a set of general, compositional, multidimensional data structures suitable for both discrete and continuous real-world data, and pairs them with separate customizable plotting classes to visualize them without extensive coding. A large collection of continuously tested IPython Notebook tutorials accompanies HoloViews, showing you precisely the small number of steps required to generate any of the plots. Some of the most important features: - Freely available under a BSD license - Python 2 and 3 compatible - Minimal external dependencies -- easy to integrate into your workflow - Builds figures by slicing, sampling, and composing your data - Builds web-embeddable animations without any extra coding - Easily customizable without obscuring the underlying data objects - Includes interfaces to pandas and Seaborn - Winner of the 2015 UK Open Source Award For the rest, check out ioam.github.io/holoviews! Jean-Luc Stevens Philipp Rudiger James A. Bednar -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] segmentation fault when saving images
Actually Paul Hobson was right. Now it works. Thanks Gabriele On Thu, Mar 19, 2015 at 1:19 PM, Benjamin Root wrote: > The warnings probably have nothing to do with the issue at hand. Try this. > Install the package "faulthandler" and add the appropriate lines to your > Bdipoly.py script and run it again. That way, we can get a traceback and > find out where it is segfaulting from. > > http://faulthandler.readthedocs.org/en/latest/ > > Ben Root > > As a side-note: faulthandler is part of the standard library as of 3.3! > Neat! > > > On Thu, Mar 19, 2015 at 1:13 PM, Gabriele Brambilla < > gb.gabrielebrambi...@gmail.com> wrote: > >> Hi guys, >> >> I don't understand why now, after I save an image when it is prompted >> out, the image is not saved and it closes automatically and on the terminal >> appears segmentation fault. >> >> this is what my terminal shows: >> >> [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py >> >> Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide >> >> lwb = 5/(np.log10(modB.max()/modB)) >> >> Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide >> >> lwe = 5/(np.log10(modE.max()/modE)) >> >> Segmentation fault >> >> >> Thanks >> >> >> Gabriele >> >> >> >> >> >> -- >> Dive into the World of Parallel Programming The Go Parallel Website, >> sponsored >> by Intel and developed in partnership with Slashdot Media, is your hub >> for all >> things parallel software development, from weekly thought leadership >> blogs to >> news, videos, case studies, tutorials and more. Take a look and join the >> conversation now. http://goparallel.sourceforge.net/ >> ___ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] segmentation fault when saving images
The warnings probably have nothing to do with the issue at hand. Try this. Install the package "faulthandler" and add the appropriate lines to your Bdipoly.py script and run it again. That way, we can get a traceback and find out where it is segfaulting from. http://faulthandler.readthedocs.org/en/latest/ Ben Root As a side-note: faulthandler is part of the standard library as of 3.3! Neat! On Thu, Mar 19, 2015 at 1:13 PM, Gabriele Brambilla < gb.gabrielebrambi...@gmail.com> wrote: > Hi guys, > > I don't understand why now, after I save an image when it is prompted out, > the image is not saved and it closes automatically and on the terminal > appears segmentation fault. > > this is what my terminal shows: > > [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py > > Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide > > lwb = 5/(np.log10(modB.max()/modB)) > > Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide > > lwe = 5/(np.log10(modE.max()/modE)) > > Segmentation fault > > > Thanks > > > Gabriele > > > > > > -- > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for > all > things parallel software development, from weekly thought leadership blogs > to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] segmentation fault when saving images
What happens when you edit your program to avoid dividing by zero? -p — Sent from Mailbox On Thu, Mar 19, 2015 at 10:14 AM, Gabriele Brambilla wrote: > Hi guys, > I don't understand why now, after I save an image when it is prompted out, > the image is not saved and it closes automatically and on the terminal > appears segmentation fault. > this is what my terminal shows: > [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py > Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide > lwb = 5/(np.log10(modB.max()/modB)) > Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide > lwe = 5/(np.log10(modE.max()/modE)) > Segmentation fault > Thanks > Gabriele-- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] segmentation fault when saving images
Hi guys, I don't understand why now, after I save an image when it is prompted out, the image is not saved and it closes automatically and on the terminal appears segmentation fault. this is what my terminal shows: [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide lwb = 5/(np.log10(modB.max()/modB)) Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide lwe = 5/(np.log10(modE.max()/modE)) Segmentation fault Thanks Gabriele -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users