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

How do you use gnuplot to plot a CSV file non-interactively? The only way I could find was

  gnuplot -e "set datafile separator \",\"; set term png; set output 'foo.png'; plot 'foo.csv'"
and if that is the best way then that's one particularly obvious advantage of graph over gnuplot.


All this verbosity can be solved by a particular .gnuplotrc, but I see what you mean.

Personally, I would rather do

    <foo.csv tr ',' ' '|gnuplot -e 'set term png;plot "-"'>foo.png


For quick plotting I use this gist for gnuplot, https://gist.github.com/jxy/88f2972d3994dfea06fd2d3833b7ac8a which generates an ascii art plot.

But I don't really use scripts for other gnuplot terminals, because custom tailoring for individual data set is always required to make any figure presentable. I usually go through ConTeXt to generate PDF file for its TeX features.




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

Search: