Skip to content

24-7 Today

Menu
  • Home
  • Ads Guide
  • Blogging
  • Sec Tips
  • SEO Strategies
Menu

How to make a Financial Times Plot with ggplot2 in R?

Posted on June 25, 2025 by 24-7

[This article was first published on Ozancan Ozdemir, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Hello folks!

In this tutorial, I will illustrate how to draw a Financial Times plot with ggplot2 in R step by step. We know ggthemes package includes a theme related to Financial Times, but the theme is depreciated now.

My reference graph for this tutorial is given below.

image

In order to draw a plot having a similar pattern with above one, I will use only ggplot2 and ggpubr packages. Texts are from windows family. I do not import any extra fonts.

Let’s get started.

I will draw an inflation rate of Turkey. You can access the data from here.

Let’s read data at first.

inflation<-readxl::read_xlsx("inflation_rate.xlsx")
head(inflation)

# A tibble: 6 x 2
  Date                 Rate
  <dttm>              <dbl>
1 2005-01-01 00:00:00  9.24
2 2005-02-01 00:00:00  8.69
3 2005-03-01 00:00:00  7.94
4 2005-04-01 00:00:00  8.18
5 2005-05-01 00:00:00  8.7 
6 2005-06-01 00:00:00  8.95

Then, draw a line plot using geom_line geometric function.

library(ggplot2)
ggplot(inflation,aes(x = Date,
                     y = Rate))+
  geom_line()

image

Now, we will start to manipulate the appearance of the plot by adding title and caption.

ggplot(inflation,aes(x = Date,
                     y = Rate))+
  geom_line()+
  labs(title = "-
       
The Inflation rate in Turkey is at the peak of the last 17 years !",
       subtitle = "Starting from January 05.",
       caption = "FINANCIAL TIMES")

image

Then, change the background color, change the color and tickness of the line and remove the vertical grid lines. We will use theme function in ggplot2 and col and sizearguments in geom_line function.

ggplot(inflation,aes(x = Date,
                     y = Rate))+
  geom_line(col = "#f20656", size = 1.2)+
  labs(title = "-
       
The Inflation rate in Turkey is at the peak of the last 17 years !",
       subtitle = "Starting from January 05.",
       caption = "FINANCIAL TIMES")+
 theme(rect = element_rect(fill = "#262a33"),
        panel.background = element_rect(fill = "#262a33"),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_blank(),
        panel.grid = element_line(color = "#92959e"),
        axis.title = element_blank())

image

After that, we will manipulate the texts on the plot. In other words, we will change the color and family of the texts. We will add the necessary arguments in theme function.

ggplot(inflation,aes(x = Date,
                     y = Rate))+
  geom_line(col = "#f20656", size = 1.2)+
  labs(title = "-
       
The Inflation rate in Turkey is at the peak of the last 17 years !",
       subtitle = "Starting from January 05.",
       caption = "FINANCIAL TIMES")+
 theme(rect = element_rect(fill = "#262a33"),
        panel.background = element_rect(fill = "#262a33"),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_blank(),
        panel.grid = element_line(color = "#92959e"),
        axis.title = element_blank(),
        plot.title = element_text(family ="Tw Cen MT", color = "white",size = 18),
       plot.subtitle = element_text(family ="Tw Cen MT", color = "#92959e"),
        plot.caption = element_text(family = "Times New Roman",face = "bold",color ="#92959e"),
       axis.text = element_text(size = 10, color ="#92959e", family = "Tw Cen MT"))

image

Next, we’ll put the y-axis values to the right of the graph. Also, we will paste % sign next to the values by using scale_y_continuous function.

image

Lastly, we will add the second caption on the lower left corner of the plot, which may be the hardest part of this process. For this purpose, we will use annotate_custom function. We know that the input of this function is grob object. Thus, we will consider ggpubr package to produce a grob text object. Then, we will clip off using coord_cartesian.

caption2<-ggpubr::text_grob("Source: CBRT", family = "Tw Cen MT",face = "bold", color = "#92959e", size =10)

ggplot(inflation,aes(x = Date,
                     y = Rate))+
  geom_line(col = "#f20656", size = 1.2)+
  labs(title = "-
       
The Inflation rate in Turkey is at the peak of the last 17 years !",
       subtitle = "Starting from January 05.",
       caption = "FINANCIAL TIMES")+
 theme(rect = element_rect(fill = "#262a33"),
        panel.background = element_rect(fill = "#262a33"),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_blank(),
        panel.grid = element_line(color = "#92959e"),
        axis.title = element_blank(),
        plot.title = element_text(family ="Tw Cen MT", color = "white",size = 18),
       plot.subtitle = element_text(family ="Tw Cen MT", color = "#92959e"),
        plot.caption = element_text(family = "Times New Roman",face = "bold",color ="#92959e"),
       axis.text = element_text(size = 10, color ="#92959e", family = "Tw Cen MT"))+
  scale_y_continuous(labels = function(x) paste0(x, "%"),position = "right")+
  annotation_custom(caption2,xmin=inflation$Date[10],xmax=inflation$Date[10],ymin=-6,ymax=-6)+
  coord_cartesian(clip = "off")

That’s it! If you wish to use this theme as a ggplot object, you can contact me via e-mail.

Related

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

©2025 24-7 Today | Design: WordPress | Design: Facts