0

I tried to run ggplot to create a theme for my charts. Everything executed properly except for the font change. Is there anyway to fix this?

Note: "h" contains the ggplot with the data

Input:

h + 
  xlab("Money Axes") + 
  ylab("Number of Movies") +
  ggtitle("Movie Budget Distribution") + # Adds title
  theme(axis.title.x = element_text(color="Darkgreen", size=30),
        axis.title.y = element_text(color="red",size=30),
        axis.text.x = element_text(size=20),
        axis.text.y = element_text(size=20),
        
        legend.title = element_text(size=30),
        legend.text = element_text(size=20),
        legend.position = c(1,1),
        legend.justification = c(1,1),
        
        plot.title = element_text(color="darkblue",
                                  size=40,
                                  family="Courier",
                                  hjust=0.5))

Output:

Warning messages:
1: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  font family not found in Windows font database
2: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  font family not found in Windows font database
3: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  font family not found in Windows font database

1 Answers1

0

Change family="Courier" to family="mono" in plot.title

YBS
  • 19,324
  • 2
  • 9
  • 27