Quality Command Line Graphing?
-
Open source, command line, low "impact", png-producing, full-featured, good-looking graphing on Linux and other Unices? We are using a script (Tcl, if it matters) to generate a script that will be sent in an email. Right now, we are using gnuplot. It's been a source of problems. No one particular thing, we just often have "issues" generating our graphs, many of them attributable to gnuplot weirdness. I'd like to rewrite it more robustly and eliminate gnuplot (on a three-strikes basis). The "open source" and "command line" are pretty self explanatory. BTW, I don't really consider gnuplot to be command line, because it has its own shell. Yes, you can script it, but I'm looking for something that will take everything (except the actual data) as command line options. "Low impact" means "not a lot of extra libs required" and is on the list because we have to manage, build and ship this stuff. "full-featured" means that something that just draws a squiggle isn't enough. The particular graph we are sending out is actually a multiplot, i.e. two graphs in the same image file. We need to be able to label axes, change colors, set ranges, etc. "png-producing" I think is non-negotiable. Personally, I would be happy to switch image formats (or better yet, go with SVG), but this email has to meet certain other requirements and I dasn't mess with the format. "Other Unices" include Solaris and Irix. It doesn't have to ship with those OSes, though, as long as it will compile there painlessly. As for "good-looking": http://www.gnu.org/software/plotutils/ is actually perfect, except for one problem: The font rendering (actually, rasterizing) is complete ass. As in nearly unreadable even at reasonable sizes. I actually confirmed this with the maintainer that there is no way to make them look better at the present time.
-
Answer:
http://pchart.sourceforge.net/ makes great-looking anti-aliased charts in PHP. I'm using it in a web-app, but you can easily call the PHP script and generate PNGs directly on the command-line.
DU at Ask.Metafilter.Com Visit the source
Other answers
Check out http://oss.oetiker.ch/rrdtool/. There's even a Tcl module. See the gallery page for some pretty pictures.
Cat Pie Hurts
Great-looking graphs from both pChart and rrdtool and if this were modern Linux only, I'd be all over rrdtool in particular. But having to compile and install a scripting language or a long list of libs onto an aging SGI or sparc isn't a good fit here.
DU
Is building and shipping statically linked binaries out of the question?
Cat Pie Hurts
No, that's in the question per se, but. The idea is that I'm trying to eliminate a source of bugs by simplifying. Tripling the number of required libraries doesn't really do that. Even if the libraries never go out as separate products, we've still got many more lines of code, more version numbers to periodically check, more interactions to debug, etc.
DU
http://www.r-project.org/ makes fantastic graphs but may be too heavy-weight for your purposes.
zsazsa
Is your objection to a scripting language due to the fact that you think you need an extra separate script file? That's not the case for plotting languages that can take their script via stdin. echo 'set key left box; set samples 50; set terminal png; set output "test.png"; plot [-10:10] sin(x),atan(x),cos(atan(x))' | gnuplot I'm not sure how this is inferior to using command line options; it's still something that you can system() (or open(), for a tiny bit more efficiency/compatibility) directly from Tcl.
roystgnr
No, we are already driving it from a pipeline. There's no one single objection to gnuplot exactly. It's just that this one corner of the program keeps giving us grief and it almost always comes down to some nitpicky thing to do with gnuplot or related libraries. I find that when a particular section of program is the source of many problems, it's usually best to rip it out and rewrite it from scratch rather than endless squash little issues. And I actually did that with this, replacing gnuplot with plotutils in just a couple hours. Much cleaner, more general and fewer lines of code--all good signs of better code quality. But then I discovered that the font ugliness I thought was just me not passing quite the right options was actually an unavoidable problem. But I guess it is not to be. Or perhaps I could fix the plotutils rasterizer...? Yeah, like I have time for that.
DU
Plotutils can generate postscript output, which you can rasterize with ghostscript.
zsazsa
In that case, one other suggestion: http://matplotlib.sourceforge.net/ In my last "how best to plot this data" hunt I ended up sticking with octave3 for graphs and using gnumeric for a few pie charts, but the above python library was tempting.
roystgnr
Related Q & A:
- How to remove path of my command line?Best solution by Super User
- How to create jar file from command line?Best solution by Stack Overflow
- Where can I get a cheap ti-83 graphing calculator?Best solution by Yahoo! Answers
- How to get games onto a TI-83 graphing calculator?Best solution by Yahoo! Answers
- What is the difference between internal command and external command in Linux?Best solution by answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.