4 ms·
I’m embarrassed to see such a post upvoted. Also, matplotlib is outdated. If you want a good visualization tool, it should leverage as many features as it can t
by juggernaut390 7y ago
I’m embarrassed to see such a post upvoted. Also, matplotlib is outdated. If you want a good visualization tool, it should leverage as many features as it can to present the most information possible. This includes not just color but interactive tools like hover tools. A library like bokeh makes this extremely easy for example. I’m a bit sad to see such posts whose purpose is to demonstrate how to leverage visualization tools to improve our understanding of a phenomenon by people holding on to legacy outdated tools. It sends the wrong message.
- b52_ 7y agoNobody cares if matplotlib is outdated. It served its purpose here, which was to show how plotting data can lead to further understanding data. You don't need a fully featured tool to do so.
- goerz 7y agoAs far as "fully featured" goes, there is nothing more fully featured than matplotlib. It just tends to take a lot more code to generate a plot, compared to some higher-level libraries, so for simple visualizations, matplotlib may not be worth the tradeoff of power vs ease of use.
- enriquto 7y agoNothing really beats "plot sin(x)" in gnuplot.
- goerz 7y agoHow is matplotlib outdated? It's just relatively low-level, so it might be quicker to use high-level tools like seaborn or altair (which use matplotlib as their backend), if that fits the situation. For heavily customized publication-ready plots (that means print), there is no alternative to matplotlib. The other two low-level Python visualization libs, plotly and bokeh (see https://pyviz.org/tools.html https://pyviz.org/tools.html) focus on interactive plots, which is an entirely different use case! Bokeh just does not generate visualizations for print. Thus, it does NOT make matplotlib obsolete. On top of that, last time I checked, bokeh was far less flexible than matplotlib.
- juggernaut390 7y agoJust wait 5 years. I was a heavy matplotlib user and before that used a primitive tool for plotting in C. It actually performed so much better than matplotlib. If working on those one or two figures for hours for a publication is what you’re aiming for, sure matplotlib is still useful for that (I did that during my PhD and postdoc days, sure it’s interesting). But I think that’s where the problem is. We have too many people stuck on an old tool because that’s all they know. I’m watching lectures and courses every morning before work and keeping up to date. It’s helped me get exponentially ahead. I think we need to encourage this mentality. This current post was about showing how to understand data. I guarantee you that if you learn to use bokeh the right way you’ll have significantly faster iteration times. Also, in industry where things are extremely fast paced, you need to move and present your information fast. Again, my disappointment is that we need to encourage a mentality of flexible learners, and I find this post a regression. I’m a bit disappointed at the unpopularity of this comment, but maybe that’s why I’ve moved up to earn an enormous salary. Try it
- nicolaskruchten 7y agoMighty matplotlib isn't going away any time soon, but just because Plotly makes interactive plots, it doesn't mean you can't also a) customize every aspect of the chart, from the fonts to the length of the axis ticks to the legend placement etc (see the full list of thousands of available customization attributes here: https://plot.ly/python/reference/ https://plot.ly/python/reference/) b) export to raster or vector formats for publication (https://plot.ly/python/static-image-export/ https://plot.ly/python/static-image-export/) c) use high-level grammar-of-graphics-inspired tools like https://plotly.express/ https://plotly.express/ to create complex charts in a single line of code.
- goerz 7y agoI haven't really looked at plotly in a very long time. At that time, it was cloud-based. Having the data I'm plotting sent to ploty's servers, or more generally, my plots depending on the availability of some remote server, was a no-go for me. Has this changed?
- earthnail 7y agoMatplotlib is incredibly powerful for non-interactive visualisations, and I have yet to find another library that offers the same flexibility. Interactive visualisations are often impractical. They don’t work in publications, presentations or documents. Generally speaking, visualisations that have everything clearly visible without requiring interaction are always superior to visualisations that require extra interactions. I found that it always paid off to do some extra thinking on how to reshape my plots so they don’t need to be interactive. I had very few cases where I needed the plots to be interactive, and ironically, in these occasions only matplotlib worked for me. Those were cases where I wanted to show and play audio snippets that belonged to data points in a dimensionality reduction plot. It was quite hard to get matplotlib to do what I want, but I didn’t even get a anywhere near a result with plotly et al.
- nicolaskruchten 7y agoPlotly has very robust static image export capabilities, meaning you can create an interactive vis for yourself in a notebook, and embed it in an app if you like, and then use the same tools to create publication-ready export in SVG, EPS, PDF, PNG etc. Here is the relevant documentation: https://plot.ly/python/static-image-export/ https://plot.ly/python/static-image-export/