Skip to content
vertesy edited this page Sep 19, 2017 · 3 revisions
  1. Get-It-Done | Quick plotting with proper annotation

I consider 3 levels of plots that I make

1. **Discovery level**: Let it be ugly, just show the relationships among your variable. Has to be dirt quick.

2. **Discussion level**: Has to be properly annotated, clean and understandable at 1st glimpse, but can have rough edges and ugly parts. Has to be quick.

3. **Publication level:** Clean pretty, and very specific. Often takes very long time to fine tune.

MarkdownReports is written and optimised for Discussion level plots, although I extensively use it for scientific publications. In the spirit of getting it done, it helps you to make discussion quality figures as quick as possible, with minimum lines of code.

You will end up writing much less in MarkdownReports then you would do in ggplot + Rmarkdown.

  1. Understandable code and traceability | Name the plot by naming the variable precisely.

  • Use dim-names: names, row names, and column names. All plotting functions take these to label axes.
  • Exact correspondence between names of your data structure and the names of your axes, plots, and filenames makes graphs traceable to the source data, as well as your code more understandable.
    • Custom naming is always possible, this is just an intelligent default!
  • In the same fashion, report files and .pdf-file's annotation field (title) inherit the name of the R-script it created them.
  1. Annotation data of the same structure | Colors defined for each data point

  • Almost all plotting functions can label each data point separately. It is very easy to trace back if you find an outlier, as annotation data is (often) in the same dimension as the data itself - it is intuitive.

  • Matching colors and legends are easy to generate by wcolorize() and wlegend()