What is the quickest and simplest way to graph or visualize numerical data that is output as text files? Transferring to Matlab is slow, Excel is clunky, things like automatic scaling are essential.
3 Answers
I think the speed and simplicity of visualizing data is largely dependent on how fluent you are with visualization tools and preprocessing tools. I'm a big advocate of scripting for this purpose, because you can figure out how to do a task once and then copy and repurpose the script on similar tasks, which saves you time.
For visualization, it really depends on what you mean by "graph numerical data" and "scalability". If you want to visualize data in 2D or do really simple 3D plots, options like Gnuplot and Matplotlib work well for data sets that don't require any more than a few processors to handle the computations. I give Matplotlib the edge for its outstanding gallery of different plots (and example scripts); Gnuplot has a similar gallery.
If by "scalability", you mean "larger data sets", you'll probably want something more along the lines of Paraview or VisIt (or if you have access to them, Tecplot or Ensight), because these tools generally have features that let you use more processors, which can handle scalability if you mean that you're processing very large data sets. If by "scalability", you mean, "generating the same plot for a large number of data sets", you probably just want to use something that you can script, and then just wrap it in some sort of for
loop. You can do something like that in any of the packages I've mentioned; most of them have Python interfaces or interfaces to other languages (with the possible exceptions of Ensight and Tecplot). Creative use of shell scripting may also work for batch processing.
Another advantage to working with Paraview or VisIt is that they have great postprocessing features for working with data, and multiple types of 3D plots. If you're using a language like Python for scripting, you can do manual postprocessing, too. A similar sort of dichotomy exists when it comes to reading in data; more complex visualization packages like Paraview or VisIt have lots of different built-in converters for reading data from text formats (HDF5, VTK, GMV, Ensight format, FLASH astrophysics data), or you can script that by hand with libraries in your favorite scripting language (mine is Python, and there are Python packages that will read in lots of different text formats).
Really, though, it's up to you what you like. If you don't like MATLAB, then I'd recommend Python for simpler tasks, because I think it's easier to install the necessary packages on a variety of platforms (for quick setups, Python distributions like Anaconda and Canopy Express are great options; you can also install everything manually if you like). Installing anything in Windows is a tremendous pain in the ass, but the Python distributions usually seem to work out better than manual installation or trying to install some sort of package manager like Cygwin that contains Gnuplot. I also think that Python code is more readable than Gnuplot scripts, that you're more likely to find useful Python code snippets you can copy, and that there are more Python users out there that will help you out.
For more complex stuff, it's really a toss-up between Paraview and VisIt. I've used both. VisIt is more intuitive to me, not having read the documentation; I liked Paraview's documentation better, and I can do more with Paraview.
Whatever you pick, if you like it, stick with it, and become an expert user.
Gnuplot does a good job here. You might also try this command line interface to Matplotlib. The interface of the latter resembles that of GNU plotutils, which gives you a third alternative.
-
$\begingroup$ Gnuplot is also embedded in Maxima, so learning the configuration strings for Gnuplot is useful for the cases where a bit of curve-fitting has to combined with data points. $\endgroup$– hardmath ♦Aug 9, 2013 at 14:00
I like to use R for all plotting. What I'll do is copy the data from the text file (which will typically be delimited). Then, I'll go x1<-readClipboard() in R. After that, t(sapply(strsplit(x1,"\t"),function(x)as.numeric(x)))->res
And your data is in the "res" object. You can make all kinds of plots. So that simple, copy and enter the two commands in R. Also, remember to replace the "\t" in your second line with the delimiter of your data (which might be a comma, space or tab). And, you have to type in the x1<-readClipboard() command or the clipboard will be replaced with the command. For the other one that puts it into res, you can copy paste it into R. You can also copy from excel files, db visualizer, etc.