Search
 
SCRIPT & CODE EXAMPLE
 

R

ggplot2 font times new roman

install.packages("extrafont")
library(extrafont)
font_import()
loadfonts(device="win")       #Register fonts for Windows bitmap output
fonts()                       #vector of font family names
##  [1] "Andale Mono"                  "AppleMyungjo"                
##  [3] "Arial Black"                  "Arial"                       
##  [5] "Arial Narrow"                 "Arial Rounded MT Bold"  

library(ggplot2)
data(mtcars)
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() +     
  ggtitle("Fuel Efficiency of 32 Cars") +
  xlab("Weight (x1000 lb)") + ylab("Miles per Gallon") +
  theme_bw() +
  theme(text=element_text(family="Times New Roman", face="bold", size=12)) #Times New Roman, 12pt, Bold
#example taken from the Github project page
Comment

PREVIOUS NEXT
Code Example
R :: ggplot_regression_line 
R :: how to read in txt/csv files into r 
R :: histogram r add line 
R :: show 2 plots together 
R :: r count distinct dplyr 
R :: ggplot2 legend text 
R :: convert index to column r 
R :: how to summarise data but keep columns R 
R :: mutate in r if else 
R :: how to get quantile summary statistics in r summarise 
R :: looping over R dictionary 
R :: stat_poly_eq position 
R :: r mode 
R :: select columns r 
R :: r ggplot hide one legend group from multiple legends 
R :: point estimates and confidence intervals in r 
R :: geom_boxplot line width 
R :: R difference | and || 
R :: L in r 
R :: average of rows in Rstudio reduce count 
R :: how to get the r2 value in r 
Rust :: rust take user input 
Rust :: ignore #[warn(dead_code)] 
Rust :: String to int in Rust 
Rust :: find last element of vec rust 
Rust :: rust•armanriazi•borrowchecker•lifetime 
Rust :: rust count distinct elements in list 
Rust :: rust•armanriazi•iterator•index•avoid 
Rust :: armanriazi•rust•error•E0277•`Point<{integer}, {float}` cannot be formatted using ` 
Rust :: how to get public addres from private key solana cli 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =