Figures & Tables
Figures and tables are a vital part of any scientific report, where you visually illustrate your approach and summarize your results. Readers will often scan them to decide whether they will even read your text, and with poor figures and tables you may lose readers before they even started. Therefore, stick to the below guidelines when producing figures and tables.
Intended for: BSc, MSc, PhD
Design
1. Be selective:
Your paper typically has a page limit, and your reader has finite attention, so carefully consider what you want to show.
BAD: You include every figure you produced during experimentation, and you far exceed the page limit.
GOOD: You selective produce informative figures that support the overall story line and research questions.
2. Be creative:
There are no fixed rules on what types of plots you should produce. Learning curves are very common, but do not feel any restrictions. Insight plots can for example be very problem specific.
Show your learning process: During experimentation you often try to find out why a certain method works or does not work. This process often automatically brings you to relevant plots. When it was useful to you to understand things, it is probably useful to the reader as well.
3. Make comparisons within a plot:
BAD: You run 5 different algorithms, generate a separate plot for each of them, and let the reader switch between different pages and axis scales to figure out which one works better.
GOOD: You run 5 different algorithms, you aggregate all learning curves in a single plot (with legend and shared axes), and draw correct conclusions in the figure caption (see below).
Figure Lay-out
1. Smooth your curves: If your outcome is noisy, smooth your curves to make them interpretable.
Do not plot a learning that only jumps up and down, and essentially fills your whole plot (see Examples below).
2. Labels: Provide clear axis labels (don't leave the reader guessing what your actually plotted). With multiple plots in one figure, add titles.
In a learning curve, you may have 'episodes' or 'steps' on the x-axis, and 'return' or 'mean squared error' on the y-axis.
3. Legend: When you have multiple lines in a single plot (which you should definitely do, see above), add a clear legend that indicates what each line represents.
In a learning curve plot, you may have 'Algorithm X' on the blue line, and 'Algorithm Y' on the red line.
4. Readable: Make sure all text in your plot (axis labels, legend, tick labels) is large enough (i.e., readable).
When you plot in Python with matplotlib, the default fontsize is small, and you usually want to increase these.
5. Export quality: When you export your figure, make sure it has high enough quality.
Given your figure the approximately right size (in cm/inches), and the export with 300 dpi ('dots per inch') to, e.g., PDF or PNG format.
You may also consider vector graphics (SVG) format, which you can enlarge without quality loss.
6. Lines: Usually only use horizontal lines in a table.
You can use the \toprule, \midrule and \bottomrule statements in Latex to distinguish lines within a table.
Table Lay-out
Use horizontal lines only! Use different horizontal lines and different fonts to make your table readable.
Use the \toprule, \midrule and \bottomrule commands for lines on the top, interior and bottom of your table, respectively. The \multicolumn is useful to make a cell span multiple columns, and the \cmidrule is useful to make a line span multiple columns.
Do not put the measurement unit in each cell. Instead, put the unit in the column header.
See this link for an extensive description of good tables.
Captions
One of the most common mistakes with figures and tables is the lack of 'self-contained' captions. The rule is simple:
The reader should be able to understand the figure/table from the caption only (without having to read the main text).
Therefore, in the figure/table caption, describe the following topics:
1. Topic: Describe what the figure shows (fully objective).
Example: "Learning curves comparing method X and Y on task Z."
2. Conclusions: Describe what conclusions you draw from the figure/table.
Example: "Method X learns slower than method Y, but eventually converges to a better optimum."
3. Setting: Describe how the figure was generated (experimental details).
Example: "Results average over 10 repetitions. Error bars depict variation over runs."
4. Abbreviations (when applicable): When you use abbreviations in the figure/table (for readability), write these out in the caption.
Example: "NN = neural network, SGD = stochastic gradient descent". But no need to write "PPO = proximal policy optimization".
Exception: algorithm names can be left abbreviated, since they are usually better known by their abbreviation (and writing them out does often not help the reader).
Bad examples
BAD figure:
Design: single setting, no comparison/baseline, nothing to learn.
Lay-out: Curve not smoothed. Redundant legend (no new information), legend entry for orange line missing. Y-axis label is wrong (authors actually plotted 'cumulative reward').
Caption: Not self-contained (at all).
BAD figure:
Design: curves could be smoothed a bit more, ideally contain error bars.
Lay-out: Legend and axis labels too small to read.
Caption: Not self-contained (at all).
BAD table (source):
No caption.
Vertical lines.
Unclear separations.
No column headers.
Inconsistent use of units of measurement (e.g. '$' should be in a column heading).
Good examples
GOOD figure (source)
Design: Learning curves that compares settings. Smoothed curves with error bars.
Lay-out: Clear legend, clear axis labels.
Caption: Self-contained. Explains the topic ("training curves of ..."), the setting ("1000-step version", "mean of 5 trials", "shaded regions correspond to ..."), the conclusion of the authors ("MBPO has asymptotic performance similar to the best model-free algorithms while ..."). No need to write out algorithm abbreviations.
GOOD figure (source)
Design: Insightful plot, authors investigated what happened during different phases of training, and visualize this to the reader.
Lay-out: Readable text, y-axis label could be improved.
Caption: Self-contained. Explains the topic ("examples of ..."), the setting ("red triangle is the agent, red square is the goal ..."), the conclusion of the authors ("The teacher first proposes very easy nearby goals, then it ...").