[英]Combine text and a fontawesome icon in facet titles in a ggplot2 chart?
是否可以在ggplot2圖表的小平面標題中插入來自fontawesome的圖標?
我想將一個圖標與文本結合起來:
使用新列,不會將fontawesome-icon粘貼到標簽上。 還有另一種方法可以做到這一點嗎?
library(ggplot2) library(emojifont) mpg %>% mutate(fa_class = paste0(fontawesome('fa-linux'), class)) %>% ggplot(aes(x = year, y = displ)) + geom_point() + facet_wrap(~ fa_class)
無法識別這些圖標:
我無法使用fontawesome()找到簡單的修復方法,但是由於您使用的是emojifont ,因此可以使用emoji()函數,然后更改字體系列。
fontawesome()
emojifont
emoji()
library(tidyverse) library(emojifont) mpg %>% mutate(fa_class = paste(emoji("car"), class)) %>% ggplot(aes(x = year, y = displ)) + geom_point() + facet_wrap(~ fa_class) + theme(strip.text = element_text(family = "EmojiOne"))
[英]Underline ggplot2 facet titles
[英]How to Fit Long Text into Ggplot2 facet Titles
[英]ggplot2 facet_grid with facet titles
[英]ggplot2: change placement of facet titles
[英]Multiple titles in facet_wrap (ggplot2)
[英]Adding dynamic chart titles in ggplot2
[英]ggplot2 - autosize chart and axis titles
[英]ggplot2 column chart with facet_grid
[英]Adding facet titles and changing legend title in ggplot2
[英]How to use subscript in titles of facet grid in ggplot2
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.