[Tex/LaTex] Looking for an efficient way to create polished scientific graphics


I’m looking for a professional and efficient way to create scientific graphics.
There are basically two types of graphics I want to create (and maybe not a joint approach works for both):

Plots of functions and data, and free body-type diagrams.

Until now I’ve been using Mathematica with MathPSfrag, but this seems too bulky now.
I know about gnuplot, TikZ, and Inkscape, although I haven’t used them extensively.
So I come here looking for suggestions.

Some requirements:

  • Pdf-output to a separate file, since some journals want it that way.
  • Have the typesetting of text and math done by a TeX-engine to get a coherent look between main text and text in figures (probably by adding a LaTeX- or XeTeX- header).
  • Cross-platform (Windows/Linux).

Also, feel free to post your workflow for creating graphics.

Best Answer

Others have already pointed to pgfplots, which I'd also agree with. It would probably be useful to have some specific pointers on how to use it to best effect. I wrote a TUGBoat article about this a while ago, but I'll try to highlight some key points here.

The first thing to say is that the exact workflow will depend on the journal your are targeting. For example, I need versions of my plots as separate files, so use the standalone class (again, this has already been mentioned). An alternative, particularly if you are looking for speed gains in a a LaTeX document, is to use the 'externalize' library to build the plots just once. The pgfplots manual describes this in detail.

Again, depending on what you are plotting having your data in a simple text format such as .csv or tab-separated makes life easier. This makes it easy to have a simple 'boilerplate' .tex file and slot in your data (name your data file based on your .tex file and you can use \jobname to add the data).

Not directly linked to the choice of data presentation system is the use of colour: it can be very useful, but needs to be done sympathetically. In particular, not all journals are too keen on colour if black-and-white will do.

Some examples from the TUGBoat article (which contains the source):

enter image description here enter image description here enter image description here enter image description here

Related Question