HACKER Q&A
📣 bwestergard

What plotting tools should I invest in learning?


I often need to plot data, generate a quick histogram, etc in the course or my working day. I often fall back on using whatever facilities are offered by a spreadsheet app.

What are your favorite plotting tools for quick data exploration at the command line? Do you use different and more general tools for publication or presentations?

Which plotting tool or tools are worth mastering?


  👤 mindcrime Accepted Answer ✓
For random, quick and dirty, ad-hoc plotting tasks my default is GNUPlot[1].

Otherwise I tend to use either Python with matplotlib, or R with ggplot2.

I keep saying I'm going to invest the time to properly learn D3[4] or something similar for doing web-based plotting, but somehow never quite seem to find time to do it. sigh

[1]: http://www.gnuplot.info/

[2]: https://matplotlib.org/

[3]: https://ggplot2.tidyverse.org/

[4]: https://d3js.org/


👤 andy99
If you're interested in GNUplot, especially for the terminal, here is a demo of doing ascii plots with GNUplot (ironically inside a jupyter notebook, but hopefully it makes sense). You can replace the terminal with something sensible (I think Cairo is the usual backend?) and run from the terminal if you want actual graphical plots.

https://gist.github.com/rbitr/7bf79860c92974182bdedce79c7de0...

In practice I use matplotlib for most plotting because the data's already coming from python. I'm not a fan of any of the grammar of graphics plotting packages but some people swear by them.

Also, I miss Matlab.


👤 brudgers
Which plotting tool or tools are worth mastering?

Excel. Not command line of course. But a sound engineering choice nevertheless.


👤 eternityforest
I almost never have to plot random data. There are many rope knots and other random things I'd rather learn than a technical task that doesn't come up much and can be Googled if needed.

I like spreadsheet apps!

I do have some features in mind that will need plotting in JS though. Not sure what the best line charts lib is these days, there's several that seem equally good.e


👤 ansgri
As a long-time ggplot and matplotlib user, I’d say skip them, start with Plotly. It allows to make quite rich interactive plots easily, and the result is either a self-contained html or code for embedding in webpage.

👤 SanchoPanda
Gnuplot in shell. It's old and finicky, but it works and whatever you want to do, someone has done it before and written it up. Those instructions from 15 years ago will still more or less work as well. I output to SVG as part of website stats tools sometimes, which is handy.

For web I like plotly. Usually I will use the UI tool to make a chart I like, and then just automate the data portion. Same for highcharts. Those UI plot makers are fantastic if you just want to template something.


👤 happyjack
Mathematica - great options, easy to change fonts, save as .Tex pdf jpeg whatever - cons expensive and propriety

Matlab - large data sets, great built in functions - cons expensive and proprietary

Python - matplotlib, seaborn

Octave - free matlab

Bonus: Tikz. I've made some really neat stuff in Tikz when I used to work in research.


👤 idorosen
My personal preferences -

Shell: gnuplot

Python: seaborn, bokeh, matplotlib, networkx/pyvis

R: ggplot/tidyverse, iplots

JS: d3, three.js

Matlab: yes.


👤 warrenm
I'd give the advice a couple others have given: use a spreadsheet

Doesn't matter if it's Excel, Numbers, Google Sheets, Open Office ... they're ubiquitous and easy :)


👤 radus
Seaborn and matplotlib for python and echarts for javascript.

👤 aborsy
Tikz and Pgfplots are the highest quality that I’ve seen.