extrafont

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font width unknown for character 0x20

风格不统一 提交于 2020-06-21 05:38:07
问题 I would like to use the free font Lato in ggplot2 graphs since the remainder of my R markdown document is set in this font. The font is installed on my system and available in the Font Book ( once only ). All available fonts are loaded with the extrafont package and registered in the extrafontdb . When I knit my markdown document as PDF, all text is correctly typeset in Lato . However, the plot labels of my ggPlots are not shown. I also receive the following warning message: Warning in grid

Internal links and URLs not working after embedding fonts in PDF kitted with R markdown

血红的双手。 提交于 2020-06-17 09:14:11
问题 I use extrafont::embed_fonts to embed fonts in a simple R markdown document which works fine. However, after embedding the fonts contained in the document, any references (internal links, URLs, citations) do not work anymore. Below an MWE with sample output (with & without embedding) is provided. Many thanks for help! MWE: --- title: "Embedding Fonts in PDF" output: pdf_document --- ```{r echo=FALSE, message=FALSE, warning=FALSE, out.width = '30%'} library(ggplot2) library(extrafont) # font

Installing fonts so that R postscript() device can recognise them

喜夏-厌秋 提交于 2020-02-06 19:34:26
问题 Based on the advice in this post I am trying to get the serif font (or 'family' of fonts) installed into R so that I can save ggplots as .eps files. Though the suggestion provided worked I would like to try to resolve the issue for future use. Here's code to generate the issue. library(bayesplot) df <- data.frame(xVar = rnorm(1e4,0,1), yVar = rnorm(1e4,2,1), zVar = rnorm(1e4,4,1)) t <- bayesplot::mcmc_trace(df) t Now when I go to save the figure I get this error ggplot2::ggsave(filename =

ggplot with customized font not showing properly on shinyapps.io

蓝咒 提交于 2019-12-20 02:41:59
问题 I can customize the font in a ggplot with: library(extrafont) windowsFonts() font_import(pattern = "comic", prompt = FALSE) loadfonts(device = "win") windowsFonts() ggplot(mapping=aes(x=seq(1,10,.1), y=seq(1,10,.1))) + geom_line(position="jitter", color="red", size=2) + theme_bw() + theme(text=element_text(size=16, family="Comic Sans MS")) This renders as: More on the subject e.g. here and here I can also integrate that plot and extrafont into a shiny app which runs locally as follows:

ggplot with customized font not showing properly on shinyapps.io

≯℡__Kan透↙ 提交于 2019-12-20 02:41:50
问题 I can customize the font in a ggplot with: library(extrafont) windowsFonts() font_import(pattern = "comic", prompt = FALSE) loadfonts(device = "win") windowsFonts() ggplot(mapping=aes(x=seq(1,10,.1), y=seq(1,10,.1))) + geom_line(position="jitter", color="red", size=2) + theme_bw() + theme(text=element_text(size=16, family="Comic Sans MS")) This renders as: More on the subject e.g. here and here I can also integrate that plot and extrafont into a shiny app which runs locally as follows:

Font family won't change in ggplot [duplicate]

家住魔仙堡 提交于 2019-12-17 14:01:06
问题 This question already has answers here : Changing fonts in ggplot2 (3 answers) Closed last year . My plot works, except I'm not able to get the font family to change. It always stays with the default, even when I can other things to change like color, size, and justification. Here's my code: ggplot(data = SeattleJuly17Data, aes(x = Price, y = SatisfactionScore, col = RoomType)) + geom_point() + xlim(0,500) + geom_smooth() + ggtitle("Satisfaction Trends by Price and Room Type") + theme(plot

Font family won't change in ggplot [duplicate]

天涯浪子 提交于 2019-11-27 15:41:57
This question already has an answer here: Changing fonts in ggplot2 3 answers My plot works, except I'm not able to get the font family to change. It always stays with the default, even when I can other things to change like color, size, and justification. Here's my code: ggplot(data = SeattleJuly17Data, aes(x = Price, y = SatisfactionScore, col = RoomType)) + geom_point() + xlim(0,500) + geom_smooth() + ggtitle("Satisfaction Trends by Price and Room Type") + theme(plot.title = element_text(family = "Calibri", size=15, color="Red", hjust = 0.5)) + xlab("Price per Night") + ylab("Guest

Changing fonts in ggplot2

送分小仙女□ 提交于 2019-11-26 03:59:19
Once upon a time, I changed my ggplot2 font using using windowsFonts(Times=windowsFont("TT Times New Roman")) to change it. 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 below with different font families. library(ggplot2) library(extrafont) loadfonts(device = "win") 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, # family="Comic Sans MS")) # family="CM Roman")) #

Changing fonts in ggplot2

社会主义新天地 提交于 2019-11-26 00:47:25
问题 Once upon a time, I changed my ggplot2 font using using windowsFonts(Times=windowsFont(\"TT Times New Roman\")) to change it. 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 below with different font families. library(ggplot2) library(extrafont) loadfonts(device = \"win\") a <- ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + ggtitle(\"Fuel Efficiency of 32 Cars\") + xlab(\"Weight (x1000 lb)\")