Questions tagged [extrafont]
39 questions
3
votes
1 answer
Import font for female and male symbols in R using extrafont or showtext for ggplot2
I am trying to use the female ♀ and male ♂ symbols in a ggplot figure. When I load the extrafont package and run the required code, it does not work (similar to this post).
I am on a Mac OS X, version 10.11.6, using R for Mac OS X, version…

Blundering Ecologist
- 1,199
- 2
- 14
- 38
2
votes
1 answer
How to use FontAwesome Free Font in ggplot
I try to plot a certain glyph using extrafont (on Windows 10):
library(extrafont)
library(ggplot2)
loadfonts()
ft <- fonttable()
ft[grepl("Awesome", ft$FontName), c("FullName", "FamilyName", "FontName")]
# FullName …

thothal
- 16,690
- 3
- 36
- 71
2
votes
1 answer
How to solve the error status 5 in extrafont?
My aim is to use the font xkcd.tff. I checked that it's installed in the dir
C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts
once I
font_import(path = "C:/Users/prgca/AppData/Local/Microsoft/Windows/Fonts",
pattern = "xkcd")
This…

GiulioGCantone
- 195
- 1
- 10
2
votes
1 answer
Changing the shape of one point or few points in a scatter plot in R
I have a set of points in a scatter plot as below. I want to change the shape of one point or few points. I searched for this but could not find a way to do it.
I want to achieve like this
And like this
Code:
df <- data.frame(x =…

Ranji Raj
- 778
- 4
- 18
2
votes
0 answers
How do you change fonts in ggplot2?
I recently learned that I need to keep the font of my thesis consistent with that of my embedded figures. Since I've decided on using Times New Roman for the body of my text, I need to revisit my figures and code them with the same font.…

Damian Popovic
- 21
- 2
1
vote
1 answer
CM Roman font in ggplot
For I can't use CM roman in ggplot.
This works:
a <- ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() +
ggtitle("Fuel Efficiency of 32 Cars") +
xlab("Weight (x1000 lb)") + ylab("Miles per Gallon") +
theme(text=element_text(size=16, …

sam
- 67
- 7
1
vote
1 answer
How to use custom font family in UpsetR plots?
I am trying to create set plot using the UpSetR package; however, I'd like to control the family of fonts. The ideal approach would be using theme function from ggplot2 but this is not supported at the moment by UpSetR (there's an open issue from…

gofraidh
- 673
- 8
- 26
0
votes
0 answers
Cannot make ggplot with Arial Narrow font, cannot font_import()
I am using R on Windows 11, and I am not the administrator of my laptop, namely I cannot run R as an administrator. I would like to make a ``ggplotusingtheme_ipsum, but I have some problems to import the Arial Narrow font on R (actually, I have…

Matteo Bulgarelli
- 135
- 7
0
votes
0 answers
extrafont R package not changing font in plot
Downloaded the font through the fontsquirrel as a TTF file.
Each font of the Latin Modern Roman was installed into the designated font Windows folder:
install.packages("extrafont")
library(extrafont)
library(ggplot2)
font_import(pattern =…

tangypancake4512
- 23
- 6
0
votes
1 answer
Font makes dashes collide with text
When I change the font to LM Roman 10 in a ggplot, it makes the dashes collide with the letters. How do I fix this, while still using this font?
---
title: "Untitled"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
…

Mads
- 85
- 1
- 7
0
votes
0 answers
Exporting ggplot with extrafont using ggsave
To have my plot match the font used for my writing, I added the font via the extrafont package. Thus, I performed the following procedure:
library(extrafont)
font_import()
loadfonts(device = "win")
This allowed me to change the font of my plot via…

Nick Glättli
- 421
- 1
- 7
0
votes
0 answers
extrafont package not importing fonts (need to use in ggplot)
I am dealing with fonts in R for the first time. I have tried every solution I could find on stack and elsewhere to get fonts into R for me, but thus far I have had no success. At the most basic level, this is what I am trying to…

bricevk
- 197
- 8
0
votes
1 answer
Using bold font with GoogleFonts
I'm a bit lost at the moment:
I have added a font to my R script via GoogleFonts and would now like to use the "bold" version. However, I can't find a way!
I've already tried various things and it doesn't work - I'm expecting a simple solution, but…

LePyka
- 181
- 8
0
votes
0 answers
Why is my font showing up in fonts() but not loadfonts()?
I'm having trouble with the ggsave() function due to what is likely a font-related issue.
When I try to run ggsave:
ggsave("new_plots/figure_1.pdf",
height = 3.7,
width = 6)
I get the following error message:
Error in…

David Færgeman
- 81
- 6
0
votes
1 answer
GhostScript was not found with extrafont
I'm using an M1, Big Sur Macbook. I need to embed the fonts of a number of pdfs that include plots from ggplot2.
However, when I run the embed_fonts() function, it returns the following error message: GhostScript was not found
With Homebrew, I…

Will M
- 692
- 9
- 20