Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;EB Garamond“;ggplot2中的字体_R_Ggplot2_Fonts - Fatal编程技术网

&引用;EB Garamond“;ggplot2中的字体

&引用;EB Garamond“;ggplot2中的字体,r,ggplot2,fonts,R,Ggplot2,Fonts,我遵循这个例子,但它不起作用。如何更改为“EB Garamont 12”字体 打印前需要包括showtext\u auto() 库(showtext) 图书馆(GG2) 字体添加谷歌(“EB Garamond”) 视窗() showtext_auto() ggplot(mtcars,aes(x=wt,y=mpg))+ 几何点()+ ggtitle(“32辆车的燃油效率”)+ xlab(“重量(x1000磅)”)+ylab(“每加仑英里”)+ 主题套装(主题灰色(基本尺寸=20,基本系列=“EB

我遵循这个例子,但它不起作用。如何更改为“EB Garamont 12”字体


打印前需要包括
showtext\u auto()

库(showtext)
图书馆(GG2)
字体添加谷歌(“EB Garamond”)
视窗()
showtext_auto()
ggplot(mtcars,aes(x=wt,y=mpg))+
几何点()+
ggtitle(“32辆车的燃油效率”)+
xlab(“重量(x1000磅)”)+ylab(“每加仑英里”)+
主题套装(主题灰色(基本尺寸=20,基本系列=“EB Garamond”))+
注释(“文本”,1,11,标签='GGTT',hjust=0,
family=“EB Garamond”,尺寸=10)
windows设备现在显示:


我没有意识到这个功能,谢谢。我如何从我的计算机(图像中的那台)加载字体
EB Garamond 12 ALL SC
?。
library(showtext)
library(ggplot2)
font_files()
windows()
font_add_google("EB Garamond")
font_families()
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_set(theme_gray(base_size = 20, base_family = "EB Garamond" )) +
  annotate("text", 1, 11, label = 'GGTT', hjust = 0,
           family = myFont2, size = 10) 
print(a) 
font_import(paths = NULL, recursive = TRUE, prompt = TRUE,pattern = NULL)

#Scanning ttf files in C:\WINDOWS\Fonts ...
#Extracting .afm files from .ttf files...
#C:\Windows\Fonts\arial.ttf : ArialMT already registered in fonts database. Skipping.
#...
#...
#C:\Windows\Fonts\ebrima.ttf : Ebrima already registered in fonts database. Skipping.
#C:\Windows\Fonts\ebrimabd.ttf : Ebrima-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\euclid.ttf : Euclid already registered in fonts database. Skipping.
#C:\Windows\Fonts\euclidb.ttf : Euclid-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\euclidbi.ttf : Euclid-BoldItalic already registered in fonts database. Skipping.
#C:\Windows\Fonts\euclidi.ttf : Euclid-Italic already registered in fonts database. Skipping.
#C:\Windows\Fonts\eucsym.ttf : EuclidSymbol already registered in fonts database. Skipping.
#C:\Windows\Fonts\eucsymb.ttf : EuclidSymbol-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\eucsymbi.ttf : EuclidSymbol-BoldItalic already registered in fonts database. Skipping.
#C:\Windows\Fonts\eucsymi.ttf : EuclidSymbol-Italic already registered in fonts database. Skipping.
#C:\Windows\Fonts\euextra.ttf : EuclidExtra already registered in fonts database. Skipping.
#C:\Windows\Fonts\euextrab.ttf : EuclidExtra-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\eufrak.ttf : EuclidFraktur already registered in fonts database. Skipping.
#C:\Windows\Fonts\eufrakb.ttf : EuclidFraktur-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\eumat1.ttf : EuclidMathOne already registered in fonts database. Skipping.
#C:\Windows\Fonts\eumat1b.ttf : EuclidMathOne-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\eumat2.ttf : EuclidMathTwo already registered in fonts database. Skipping.
#C:\Windows\Fonts\eumat2b.ttf : EuclidMathTwo-Bold already registered in fonts database. Skipping.
#C:\Windows\Fonts\fences.ttf : Fences-Plain already registered in fonts database. Skipping.
#C:\Windows\Fonts\framd.ttf : FranklinGothic-Medium already registered in fonts database. Skipping.
#...

extrafont::loadfonts(device="win") #I can't find EB Garamond