Questions tagged [showtext]

23 questions
150
votes
7 answers

Changing fonts in ggplot2

Once upon a time, I changed my ggplot2 font using windowsFonts(Times=windowsFont("TT Times New Roman")). Now, I can't get it off of this. In trying to set family="" in ggplot2 theme(), I can't seem to generate a change in fonts as I compile the MWE…
EngBIRD
  • 1,915
  • 3
  • 18
  • 22
5
votes
1 answer

Conflict between 'ShowText' and 'LineStyle' in the contourf function in MATLAB R2019a?

I'm using the code as follows. But the figures are different when I run my code in MATLAB R2014a and R2019a (in the same computer, Win7 64bit). It seems there is a conflict between 'ShowText' and 'LineStyle' in function contourf in MATLAB R2019a ?…
JQY
  • 91
  • 3
5
votes
2 answers

Fonts not loading in showtext font_add_google

I'm trying to graph some data and my code looks like this: library('ggplot2') library('tidyr') library('ggthemes') library('showtext') font_add_google('Syncopate', 'Syncopate') showtext_auto() ggplot(aes(x = X, group=1), data = glassdoor)+ …
snapcrack
  • 1,761
  • 3
  • 20
  • 40
5
votes
3 answers

ggsave() does not bolden text, and it changes font of all text instead of just plot title

I'm making a chart in ggplot2 and ggsave() does not do what I expect. require(ggplot2) require(showtext) showtext_auto() hedFont <- "Pragati Narrow" font_add_google( name = hedFont, family = hedFont, regular.wt = 400, bold.wt = 700 ) chart…
Username
  • 3,463
  • 11
  • 68
  • 111
4
votes
0 answers

Does showtext package in R allow fontfaces other than regular, bold and italic?

I'm trying to use different fontfaces for a plot, I'm using showtext to load the font. Working code goes: library("tidyverse") library("showtext") font_add(family = "nutmeg", regular = "/nutmeg/Nutmeg-Regular.ttf", bold =…
e_terr
  • 43
  • 6
3
votes
1 answer

ggplot text rendering not working for some fonts

I have been trying to add a google font to my ggplots, but the text renders with lots of gaps in it. Does anyone know how to fix this? Seems like it may be an operating system specific problem. I'm using: OS: MacOS Catalina 10.15.7 R version:…
unknown
  • 853
  • 1
  • 10
  • 23
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
3
votes
1 answer

Using Google Fonts in RMarkdown main body without admin privileges

I want to define the fonts to use in my RMarkdown PDF document. I’d like to use a Google Font, say, Roboto, but I do not have admin privileges to install it directly. Nevertheless, I think that I can work around these privileges, as I’ve installed…
Dan
  • 11,370
  • 4
  • 43
  • 68
2
votes
1 answer

How to add icons to ggplot captions and titles?

Right now I am trying to put icons in ggplot visualizations. To this end, I have checked a couple of tutorials on the web and when I run the following code example of Claus Wilke, library(ggtext) library(ggplot2) ggplot(mtcars) + aes(mpg, disp)…
mzkrc
  • 219
  • 2
  • 7
1
vote
0 answers

How do I stop a ggplot graph legend from getting cut off on the right when exporting-saving when using showtext?

Just started R a couple weeks ago. Getting familiar with ggplot. I successfully made the graph I wanted to including all legends, axes titles, etc. I'm able to export/save this image fine. However, the assignment also required me to change the font…
Jeff
  • 11
  • 2
1
vote
0 answers

ggplot2 - plotting time is drastically slower on second and following plots in session (RStudio)

I have an issue, where the first plot of a ggplot script in a RStudio session is really quick (~ 2-3 seconds) and all following plots in the same session, using exactly the same script, take significantly longer (~ 10-20 seconds). I also often need…
Jan
  • 157
  • 9
0
votes
0 answers

R showtext added font not available on next start

I'm trying to move away from the extrafont package due to these issues. This is a bit of a shame as apart from that this package works great; but alas it seems that showtext is the best alternative. But I'm struggling a bit as the documentation of…
Moritz Schwarz
  • 2,019
  • 2
  • 15
  • 33
0
votes
1 answer

How to use the dalek font in R plots?

I want to use the dalek font in my R plots. I tried to use the showtext plot, but I had no success. Can someone provide some guidance?
Sinval
  • 1,315
  • 1
  • 16
  • 25
0
votes
0 answers

Why are certain characters not rendering properly in ggplot2 with installed font?

I have installed Jeko font using the show_text library, however certain characters are not rendering properly when plotted with ggplot2. Here is my current…
0
votes
0 answers

changing font (from default) to Calibri (or other) and bold the text (ggplot)

I would like to use Calibri instead of Arial and bold the title. I used showtext package and was successfully get calibri font. However, I could not bold the text (as title). I also used ggtext to customize color and font size but was not able to…
Minh Dang
  • 11
  • 1
1
2