8

What are good choices to produce charts in computer science research papers? For example, I think Figure 8 from Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores (pdf), included below, is great. What tools were used to produce it?

Figure 8: Read-only Workload – Results for a ready-only YCSB workload

Source: Xiangyao Yu et al., ibid., p. 215.

12

You can use TIKZ and PGFPLOTS packages in latex to produce beautiful figures, see these pages for some examples, TIKZ examples and PGFPLOTS examples.

Matlab and python are powerful software for producing nice plots. Barchart creation using Matlab, Barchart Matlab examples, and Python example, Python matplot example.

  • 2
    Matlab plots look quite bad if one exports them without significantly tweaking the default settings. The lines are too thin, the characters are too small, the font is different from the one in your paper, and up to a few versions ago the colormap was not printer-friendly. – Federico Poloni Sep 15 '16 at 6:26
  • 1
    And, to answer the second part of the question: figure 8 in the paper OP mentioned does not look like Tikz at all. – Federico Poloni Sep 15 '16 at 6:29
  • (That said, +1 for the Tikz suggestion -- I don't want to seem too critical of this post.) – Federico Poloni Sep 15 '16 at 6:30
  • @FedericoPoloni by Matlab you can produce high-quality plots but it needs to set the parameters carefully (I agree that the default parameters are not good.) Also, the true point on Tikz and barchart creation using it! I just mentioned it for the first part of the question. For barchart creation, Pgfplots is a very good tool. – Hadi Sep 15 '16 at 7:02
  • 2
    @FedericoPoloni Matlab's default fonts are Helvetica (TeX interpreter) and Computer Modern (LaTeX interpreter), but you can easilly change the font to, say, Palatino or Times - compatible with exportfig. Default setup and default export produce awful grapics, but it is not that difficult to make them look nice. You have to know what you want to do. – Crowley Sep 15 '16 at 10:04
25

To add to other answers that will probably suggest some nice, specific software:

Use whatever you are comfortable with. I personally don't think this figure 8 is that special, and I don't even think it has any features that cannot easily be done with something as common as Excel. As also mentioned in some comments: even the potential graphical powerhouse Matlab will produce crappy figures if you use the standard settings. The same for some other "go-to" software packages. But you have to be able to use them.

In almost all of the mentioned software you can adapt (almost) everything, and some default settings look better than others (one of the reasons why Excel has such a bad reputation).

The most important thing is that you decide how a graph should look, and actually make it look like that. Don't settle for default colors / font sizes and line widths! Whatever software you use to get there is your choice.

If you're fluent in MS Office: probably you should just use Excel. If you like to write scripts and use commands instead of clicking everywhere: Matlab might be an option. If spent 3 years getting good at using Graphpad but don't like how the graphs look? Just adapt them to fit your tastes, don't be limited by the default settings.

And when exporting them use the right settings. Many journals accept vector graphics, which will always look better, but the journal has to accept those. Figures also need to be the right size. Everything can look perfect printed 12 cm wide, but when your graph has to fit one column (8.5 cm), the same graph will look too small with unreadable fonts.

  • 9
    +1 Design is so much more important than software. You can make terrible design with the best software. – jakebeal Sep 15 '16 at 9:36
  • 1
    I'd actually go far enough to reverse the theme of your last paragraph. Ideally authors should (re)read the journal guidelines/conference guidelines for figures before they actually start producing plots to check what output formats are acceptable. It's also nice to give a little thought to what they'll look like in black and white, for those few still more comfortable with paper. – origimbo Sep 15 '16 at 14:35
11

Adding to the other answers for the sake of completeness:

gnuplot

Gnuplot is always an option if you do not want to use Python or R. It is freely available and can be used on most platforms. Also plotting can be automated using shell scripts.

Inkscape

Inkscape is a vectorgraphics tool that can be used to create nice graphics. While it provides a rudimentary function plotter and can render TeX code I would advise against using it to create graphics.

In enhancing plots however, Inkscape can be invaluable. You can use Inkscape to edit svg and pdf files created by other plotting tools, like matplotlib, gnuplot, etc. I use this for grouping, recoloring, editing and adding labels, and other fine tuning tasks.

Inkscape is also available on most platforms. To edit a pdf file just open it with Inkscape (File -> Open).

Off Topic: Literature

As others have mentioned, it is not the tool, it is what you do with it. While this might not be a direct answer to the question, I would like to recommend the Edward Tufte's book Envisioning Information. It explores several facets of what makes a good visualization of data and how to highlight what you actually want to show.

9

Currently, the ggplot package in R is the best for producing very clean plots. matplotlib is fine, but it's not as easy or as flexible as ggplot. seaborn is another python package that wraps around matplotlib to make it a little easier.

But ultimately, as @VonBeche says, do what's most comfortable for you.

7

PGFPlots

@Habi mentioned it already, but I thought I would go into more detail about why PGFPlots.

Here is what might happen over the course of a particular piece of work.

  1. I do some work, gathers some bulk data, simulate some things
  2. I have an analysis Jupyter Notebook that loads up the raw data, and a Subset it, and analysis it in jupyter, using what ever plotting tools I like.
  3. (or 2b.) I export the key data from jupyter into a CSV (that I version control along side my latex documents)
  4. I write up code to plot it using PGFplots into my paper

Then stuff happens.

  • A university event wants me to talk about my current research -- got to make a slideshow
    • copy paste that pgfplots description into a Beamer presentation, change the colours to match my university theme. And adjust the scale. (Takes only a few minutes)
  • I need to have a poster for a conference
    • Copy paste the the plot description, tweak the sizing. Use the poster color scheme. Again minutes.
  • I screwed up the analysis, the plots in my paper are wrong (hopefully not too wrong).
    • Click "Run All in Jupyter"
    • Click Compile in my LaTeX editor
    • Done

Vs if I was exporting a Plot (and a png, of even svg or pdf, rather than CSV data) from a plotting tool (like matplotlib). I would have to mess around trying to get the size, resolution and color right for all the different versions of the plot -- I find that is much easier to do in latex. And I would need to manage all those different plot files. It is still automatable, but now my presentation settings (style), live with my Analysis (in Jupyter), rather than in with my writeup (in LaTeX).

Side bonus is that Plots produced with PGFPlots use the same font as the rest of your document, and can use named colours you have defined in your document. And the text ends up highlightable (rather than as a image of text).

6

VonBeche's advice "Use whatever you are comfortable with" is best, no shame in using excel if it works.

That said, may I suggest Plots.jl? It has one of the simplest, but most flexible apis I've seen. The biggest advantage over others is it tries to display something for whatever data you throw at it. It can be as simple as:

plot(rand(10,5))

More complex examples such as animated gifs: animated gif of lorentz

can be easily built with only a few more lines of code

Best of all, it is a front-end to many of the packages mentioned here (PGFplots, TIKZ, Matplotlib, others such as Plotly), so you can always change your final output format later

It is available as a package for the Julia language - which is a similar system to matlab

Not the answer you're looking for? Browse other questions tagged or ask your own question.