High quality graphics for Latex documents: The Matlab route
io.ac.nz
io.ac.nz
You can also use TikZ to call gnuplot from within the LaTeX document, or generate TikZ code from within gnuplot.
A very brief introduction:
http://tex.stackexchange.com/questions/106512/gnuplot-in-lat...
I am relatively new to org-mode (via Spacemacs). But I really like it, you can use it as a quick notebook to jot down things, run code, and export the result as PDF per LaTeX.
http://pgfplots.sourceforge.net/
It delivers nice vector graphics plots, and since it's in your .tex file, it automatically picks up any and all styling changes you have made in the preamble. You can have it re-render plots on each LaTeX compilation, or just conditionally re-render plots if the data has changed.
(As always, latexmk [ http://mg.readthedocs.io/latexmk.html ] comes highly recommended for automating the compilation of LaTeX documents.)
I'd also second the latexmk recommendation!
For non-plots I love Sketch (http://sketch4latex.sourceforge.net) which is pretty great for doing diagrams with 3D objects, especially if you use the sketch-lib (https://alexdu.github.io/sketch-lib/) which provides a bunch of useful simple objects to manipulate.
I am a tex/latex survivalist :)
My students all started out using root/matlab/whatever for plots. Except for the matlab guy, sooner or later, they all switched to gnuplot. Not forced by me.
It doesn't appear that the objective merits of the tools under discussion yield a single best answer. For example, if you look through various implementations of assorted somewhat-esoteric algorithms & formulae, I have found that the FORTRAN implementations are usually cleanest. Not because the language is cleaner or anything like that, but because the most experienced people in the field didn't see the point of bowing to language fashion.
If fashion were the deciding point I suppose we'd all be compelled to use JavaScript, so, yeah. I'd rather not reimplement something that already works right, least of all when it's a fiddle problem and I've got deadlines to hit.
You make a great point. The only thing that I'd add is that a lot of the Fortran code that I'd rely on (large venerable linear algebra and ODE packages) were written a long time ago, when it would have been somewhat less unfashionable.
All the same your comment makes me think I may have dismissed it too quickly so I'm going to give it another try for my next toy project (even if they index arrays from 1). Thank you.
Fortran is popular among people in many disciplines doing large-scale scientific computing. I was surprised to learn a few years ago that C++ had become popular in the high energy physics community; the emphasis there is on crunching vast amounts of data from experiments.
They don't have to! You can set the array index bounds to whatever you want. For example,
real(8) A(0:n-1)
real(8) w(-p:q)
are both valid declarations and would be indexed by i=0,n-1 and i=-p,q respectively. If you're using gfortran compile with the "-fbounds-check" flag to save a lot of headaches!If a hypothetical Fortran 201x added Python-esque generic lists and list/array comprehensions that played well with strings, and promoted strings to a "first class" type, I'd have a lot less reason for pulling in Python for scientific applications not involving web/graphics.
Example A of the wrong type of figure for any possible context: 3-dimensional pie charts.
Most pie charts are terrible as well, it's very hard to compare the sizes of slices. There's a good piece on pie charts at http://www.businessinsider.com/pie-charts-are-the-worst-2013... with a quote from Edward Tufte: "Pie chart users deserve same suspicion+skepticism as those who mix up its/it's, there/their.To compare,use little table, sentence, not pies."
The combination, especially when used for a publication, is just a disaster.
[1] http://journals.plos.org/plosone/article?id=10.1371/journal....
I have created some high quality, complex plots out through matlabl2tikz with no problem. I haven't had the issues the author notes and I'd suggest they file a bug report. The m2t community is active and friendly.
The other bonus of m2t is you can edit the files in PGFplots, which is a powerful and complete language/library. For my use case, it was important that my plots be repeatable, so manually doing it with Inkscape would be tedious. Having easily editable source code allowed me to write scripts to filter the output to what I needed.
The one problem I did find is that pgfplots can be quite slow. This isn't m2t's fault though and can be overcome with TikZ's cache system.
Disclosure: I wrote the path simplification in matlab2tikz, but nothing else.
But everything in MATLAB, then I just symlink the pdf figures to the manuscript folder, so with an F5 in MATLAB and a build in Sublime I have the manuscript updated.
You could probably do the same thing but do the export of the tikz file instead of the PDF. That's basically what I do.
Its a very manual process though, but I think the graphics that come out of it seem to be nicer than Matplotlib, and Matlab can do. Am I crazy, or should I really consider something like this?
The proof of concept worked well for line and contour plots, but my thesis got in the way of completing this.
Actually, a quick search yielded [2], so it appears that ggplot2 is supported as well. And apparently supported in one of the knitr examples [3] (if you use knitr, which I highly recommend).
[1] https://cran.r-project.org/web/packages/tikzDevice/index.htm...
[2] http://iltabiai.github.io/tips/latex/2015/09/15/latex-tikzde...