What is the ectrlplot package?

This is an R package, developed by the PRU team to make the process of creating publication-ready graphics in our in-house style, using R’s ggplot2 library, a more reproducible process.

The package is constisted of the following functions:

Why to use it?

This package can be used to give to the graphics made by the PRU team a consistent customized look.


The following examples will help you understand how to use ectrlplot package and its components step by step.

Example 1

Let’s start with a basic scatterplot example.

Add theme_pru()

Modify components of the theme_pru()

If you want to modify some components of the theme_pru(), use theme() and add your preferences. In this example, the Y axis line is added and the Y axis grid lines in the panel are removed.

See how to modify components of a theme.

Add the logo

Finish the plot by adding the logo, the source and the filepath that you want it to be saved.

The EUROCONTROL logo is the default in this package. If you want to use your own logo, modify the function by adding the parameter logo_image_path.

Example 2

Now, let’s see how to use the ectrlplot package in ggplot2 bar chart.

Add theme_pru()