I have a report were I output some ggplot-charts with device = svg in rmarkdown. Output-format is html. Unfortunently I get lots of warnings like below. I don't get any warnings if I specify device = png
## Warning in grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
## font width unknown for character 0x53
Anybody knows why png works (or atleast doesn't give any warnings) but not svg? Session info and non-reproducible code below. I use extrafont which I guess may have something to do with it.
Sessioninfo:
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=Swedish_Finland.1252 LC_CTYPE=Swedish_Finland.1252
LC_MONETARY=Swedish_Finland.1252 LC_NUMERIC=C
[5] LC_TIME=Swedish_Finland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] extrafont_0.17 cairoDevice_2.23 Cairo_1.5-9 RODBC_1.3-13
loaded via a namespace (and not attached):
[1] magrittr_1.5 htmltools_0.3.5 tools_3.3.1 yaml_2.1.13
Rcpp_0.12.5 stringi_1.1.1 rmarkdown_1.0 extrafontdb_1.0
[9] knitr_1.13 stringr_1.0.0 digest_0.6.9 Rttf2pt1_1.3.4
evaluate_0.9
Code-chunk:
```{r plot2, echo = FALSE, fig.show='hold', out.width='50%', dev=c('svg')}
ggplot-code example:
ggplot(dt.bar2_1,
aes(x=factor(Mon), y=nsk_rel, fill =Class)) +
geom_bar(stat="identity", position = "dodge")+
scale_fill_manual(values = c("#6baed6","#3182bd"), name = "Type") +
scale_y_continuous(labels = percent,
breaks = c(0, 0.02, 0.04, 0.06, 0.08, 0.10),
limits = c(0, 0.10))+
theme(axis.text.x = element_text(size=11),
axis.text.y = element_text(size=11))+
xlab("Month") + ylab("Freq")+
ggtitle(Title.2_1) +
theme(plot.title = element_text(family = "Trebuchet MS",
color="#666666",
face="bold",
size=16,
hjust=0))
When calling fonttable()
: