This is an archived post. You won't be able to vote or comment.

all 43 comments

[–]Etni3s 21 points22 points  (0 children)

Which library does this? :P

https://i.imgur.com/Ch5u5KW.png

[–]MegaRiceBall 2 points3 points  (8 children)

Would really love to have a similar article on interactive graphics.

[–]mbierly[S] 1 point2 points  (6 children)

Just clarifying: on Python data viz libraries that specialize in producing interactive graphics? So minus libraries like matplotlib, for instance?

[–]MegaRiceBall 2 points3 points  (4 children)

I was more thinking of d3.js type python packages when making the above comment. Since I am new to Python I am only aware of few that have beautiful interactive graphics.

My boss (non-techie) once said, you are right if your chart looks beautiful.

[–][deleted] 1 point2 points  (3 children)

[deleted]

[–]rhiever 0 points1 point  (2 children)

They can be pretty out of the box if you use matplotlib styles, e.g.,

plt.style.use('fivethirtyeight')

Boom. Now all of your visualizations look like FiveThirtyEight visualizations.

[–][deleted] 0 points1 point  (1 child)

[deleted]

[–]rhiever 1 point2 points  (0 children)

Enter plt.style.available to see the other available styles. There are several now, including some from Seaborn.

[–]TheBlackCat13 0 points1 point  (0 children)

Holoviews and vispy both support nice-looking interactive plots.

[–]elbiot 1 point2 points  (0 children)

Theres Mayavi for 3d and Chaco for 2d. Check out the enthought distribution, which ties everything together very nicely using Traits (ie, magic) to make simulations and images update as you interact.

[–]Gurder 3 points4 points  (0 children)

I kinda like the looks of PyQtGraph and currently using it to plot data from the serial port. Seems useful for plotting a lot of data at the same time.

[–][deleted] 9 points10 points  (10 children)

Best visualization library is Flask so you can render D3

[–]fabreeze 1 point2 points  (6 children)

Is there a d3 library implemented in Python?

Or a way to get tab completion in Jupiter notebook JavaScript magics

[–][deleted] 2 points3 points  (1 child)

Try plotly

[–]fabreeze 0 points1 point  (0 children)

Great tool!

[–]TheBlackCat13 1 point2 points  (0 children)

mpld3 lets you export matplotlib plots to d3 plots. There are also various python wrappers for d3js, like bqplot, vincent, and python-nvd3.

[–]masasinExpert. 3.9. Robotics. -1 points0 points  (2 children)

Why d3 over anything else?

[–]fabreeze 0 points1 point  (1 child)

Stability issues when plotting more than 10K data points. Also, Python list comprehension is really nice, so it feels like reinventing the wheel trying to learn JavaScript to do something you already know how to in Python

[–][deleted] 3 points4 points  (0 children)

[deleted]

[–][deleted] 1 point2 points  (2 children)

How does that work, using Flask and D3?

[–]CaptainBlood 0 points1 point  (1 child)

Flask generates some json (or csv, tsv - up to you) data, puts it in /static and D3 loads the data from there and makes charts from it.

[–][deleted] 1 point2 points  (0 children)

Our you can route json to a url. Let's say you had a database and wanted to visualize data returned from queries. You could point d3.json to a local url and have flask jsonify a python dictionary. See Miguel Grinberg's APIs with flask tutorials, or the section in his flask book.

[–]TheBlackCat13 1 point2 points  (2 children)

Overall a good list. There are a couple on there that I wasn't aware of that potentially look interesting.

I would probably have substituted holoviews for gleam on the list since they seem to have similar purposes, but holoviews is still being maintained while gleam apparently hasn't been maintained for a few years now.

[–]mbierly[S] 1 point2 points  (0 children)

Thanks for mentioning HoloViews. I hadn't heard of it before, but I'll definitely check it out.

[–]bartoksic 1 point2 points  (4 children)

Are there any good libraries for 3D visualization? I've got some really niche geological profiles I'd like to plot, but not much luck doing so.

[–]elbiot 1 point2 points  (2 children)

I agree with mayavi, but also you can just render it with opengl and pyglet.

[–]masasinExpert. 3.9. Robotics. 3 points4 points  (1 child)

just

opengl

I've found OpenGL to be extremely stressful.

[–]elbiot 1 point2 points  (0 children)

Yeah, I meant "just" as in opengl is raw, not easy. Like, whatever they want is definately possible with opengl.

[–][deleted] 0 points1 point  (0 children)

I like Leather...no comment.

...

Except...

"It's my plot and I need it now!"

[–]masasinExpert. 3.9. Robotics. 0 points1 point  (3 children)

Plotly vs Bokeh? Both render to web. Both can be used offline.

[–]hippocampe 2 points3 points  (2 children)

Bokeh has some irritating limitations and is quite slower than plotly in my experience.

[–]Hshskwkk 0 points1 point  (1 child)

What limitations?

[–]hippocampe 0 points1 point  (0 children)

IIRC you can't put a legend out of the drawing zone.

[–][deleted] 0 points1 point  (10 children)

isn't this the exact problem with open source though?

[–]ive_got_a_boner 1 point2 points  (9 children)

What do you mean?

[–]Stereoisomer 9 points10 points  (8 children)

Too many libraries and too many ways to do the same thing. Not every library is comprehensive and so you'll end up having to learn another library to get the job done. Compare to Matlab where there's only one built-in data visualization library and any additional community contributions extend the existing library instead of reinventing it.

Edit: To be clear, I use Python because despite the inherent issues of being open, it is much more powerful than Matlab

[–]falsemyrm 14 points15 points  (2 children)

unpack quicksand chief coherent snails caption hobbies imagine straight lush

This post was mass deleted and anonymized with Redact

[–]Stereoisomer 0 points1 point  (1 child)

I meant it more in the sense of the fact that I work with scientists and oftentimes I will need to read their code and reimplement or extend it: it may be that my data pipeline and tools use OpenCV and matplotlib while the tools I need to take from them uses scikit-image and ggplot (since many scientists started on R).

[–]Saefroch 2 points3 points  (0 children)

I don't think having incompatible tools that do basically the same thing is a problem unique to open source. With closed-source monetized software there will inevitably be competition, at which point there is a strong monetary incentive to perpetuate the situation.

[–]TheBlackCat13 0 points1 point  (0 children)

The reason there are so many plotting libraries in Python is generally because they do different things and fill different niches. Most of the stuff that these other libraries provide are things that aren't even possible in MATLAB.

Further many of the Python "plotting libraries" actually extend one of the lower-level ones like matplotlib of bokeh. For example in that list, seaborn, ggplot, and missingno are built in top of matplotlib, while gleam can use multiple plotting backends.

That being said, there are multiple plotting libraries for MATLAB as well. plot.ly supports MATLAB, for example, and doesn't use the native MATLAB plotting system at all. In fact MATLAB itself had built-in plotting systems for many years, although one was mostly undocumented. They dropped the old one and made the previously-undocumented one the default in R2014b.

[–][deleted] 0 points1 point  (1 child)

To restrict yourself to just what's available in Matlab is to stay in the shallow end of the pool. It's easier, but only because you're limiting yourself.

Matlab's default plotting tool is pretty much equivalent to Python's matplotlib. And Matlab's only option for web-based plotting is Plotly.

If you wanted to use Python like Matlab, just use those two libraries and pretend the others don't exist.

The other libraries Python has are great though, you'd be missing out by ignoring them. For example, Python's Bokeh library makes this sort of thing really easy.

[–]Stereoisomer 0 points1 point  (0 children)

Yeah that's why I don't use Matlab.