Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One could also use Python and matplotlib for plotting in org mode. Gnuplot is not the only thing one can use.


Matplotlib already has a pretty uncomfortable API. I can’t imagine that wrapping that in a layer of elisp would result in anything nice to use at all.

It would probably be a case of the thing OP mentioned, where the amount of code needed would exceed just doing it yourself.


Gnuplot is the best plotting interface I’ve ever used. Once you’ve learned “the Gnuplot language”, it’s very fast and efficient to visualize anything and iterate on it interactively, and I personally find it more usable than GGPlot, Matplotlib, Seaborn, Bokeh, and Matlab.

I think Gnuplot is undervalued because by default the results look horrible. Like many power tools, it requires some config in ~/.gnuplotrc to modernize the looks; http://gnuplotting.org/ is a great source to get started.

Unfortunately, I’m mostly using Matplotlib these days because the data generation is in Python. But despite using it on and off for over a decade, I’m nowhere near my efficiency in Gnuplot, and often have to ask Google or Copilot for help if I’m doing something more complex.


Gnuplot is fantastic. And with the epslatex terminal, it sets the graphics in EPS and the text elements in TeXsobtgat you can get everything typeset juuuuuust right.


To address your python woes: https://github.com/dkogan/gnuplotlib/ Gnuplot is excellent, and I use it every day.


I find Gnuplot syntax to be terse and unintuitive, and having poor discoverability without constantly refer to the docs.


In Gnuplot you can indeed write each command in a very terse way; some simple examples:

    plot cos(x) ls 2, sin(x) ls 3

    plot 'file.dat' u 1:2 w lp lw 3 ps 2
But you can also write the same code in a descriptive way:

    plot cos(x) linestyle 2, sin(x) linestyle 3

    plot 'file.dat' using 1:2 with linespoints linewidth 3 pointsize 2
I think most people prefer the terse version once they learn it. But I’d definitely recommend learning the descriptive commands first, as the abbreviations follow very naturally from there.


You're not wrapping it in elisp. You can just write matplotlib in a code block, evaluate it, and pop out an image to your buffer.


Matplotlib has 2 APIs, a procedural one and an object oriented one. Which one are we talking about? Or both?


Seaborn, plotly, datashader, etc. all exist to wrap matplotlib and they are wildly successful. Is there some reason an equally good interface couldn’t be written in elisp?


One thing that always bothers me with both matplotlib and gnuplot, is that they literally seem to have a command (or function call) for everything. To set the tick size for the third-level ticks on the Y axis, you call set_third_level_y_ticks() or something like that. This is not necessarily bad (and maybe it has to be this way — I haven’t even tried to analyse the problem) but it feels very un-orthogonal, like everything is special-cased.


If you’re looking for something “orthogonal”, you should definitely have a look at GGPlot and its “Grammar of Graphics”.

Personally, I prefer the Gnuplot approach, but I think GGPlot has some cool ideas behind it :)


There is also ESS (Emacs Speaks Statistics) which, among other things, supercharges org-mode with R/Julia, which means the likes of ggplot2 or makie. That said, I do respect any attempt at making something with pure elisp.


You can also use R and it's plotting libraries.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: