gogplot2에서 이모티콘으로 음모를 꾸미려고합니다. 내가 원하는 건 라벨 대신에 그림 이모티콘을 보여 주거나 기러기처럼 보이게하는 것입니다. This question 스택에 내 문제는 매우 비슷하지만 해결되지 않습니다, 대답은 꽤 수동이며 자동 (내 실제 데이터 프레임 3000 행이 있습니다)해야합니다.그림 이모티콘/이모티콘 (ggplot 포함)
아래의 그림에서 명확히하기 위해 텍스트 레이블 대신 또는 이모티콘을 emojis로 표시하려고합니다. 그러나 불가능한 것 같습니다.
differents의 솔루션 내가 쌓여있어 시도 후 그래서 어떤 도움을 주시면 감사하겠습니다. 나는 here, here, here와 같은 문제에 직면하는 여러 가지 방법을 읽었다.
mult_format <- function() {
function(x) emo::ji(x)
}
ggplot(foo, aes(name_emoji, n)) +
geom_bar(stat = "identity") +
coord_flip() +
scale_y_continuous(labels = mult_format())
그러나 그것은 작동하지 않습니다
내 마지막 시도는 다음과 같이이었다.
내 데이터는 다음과 같습니다, name_emoji는 emo package에서 cames, 나는 또한 바이트로 변경할 수 있습니다 여기에
name_emoji n emoji
<chr> <int> <chr>
1 closed book 1 "\U0001f4d5"
2 confused face 7 "\U0001f615"
3 dizzy 20 "\U0001f4ab"
4 face with tears of joy 1 "\U0001f602"
5 flexed biceps 1 "\U0001f4aa"
6 light bulb 1 "\U0001f4a1"
가 재현 :
structure(list(name_emoji = c("closed book", "confused face",
"dizzy", "face with tears of joy", "flexed biceps", "light bulb"
), n = c(1L, 7L, 20L, 1L, 1L, 1L), emoji = c("\U0001f4d5", "\U0001f615",
"\U0001f4ab", "\U0001f602", "\U0001f4aa", "\U0001f4a1")), .Names = c("name_emoji",
"n", "emoji"), row.names = c(NA, -6L), class = c("tbl_df", "tbl",
"data.frame"))
사전에 감사!
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] es_ES.UTF-8/es_ES.UTF-8/es_ES.UTF-8/C/es_ES.UTF-8/es_ES.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
other attached packages:
[1] emo_0.0.0.9000 emojifont_0.5.1
[3] DataCombine_0.2.21 forcats_0.2.0
[5] stringr_1.2.0 dplyr_0.7.4
[7] purrr_0.2.4 readr_1.1.1
[9] tidyr_0.7.2 tibble_1.3.4
[11] ggplot2_2.2.1 tidyverse_1.2.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 lubridate_1.7.1
[3] lattice_0.20-35 twitteR_1.1.9
[5] sysfonts_0.7.1 assertthat_0.2.0
[7] digest_0.6.12 psych_1.7.8
[9] mime_0.5 R6_2.2.2
[11] cellranger_1.1.0 plyr_1.8.4
[13] httr_1.3.1 rlang_0.1.4
[15] lazyeval_0.2.1 readxl_1.0.0
[17] rstudioapi_0.7 data.table_1.10.4-3
[19] miniUI_0.1.1 proto_1.0.0
[21] labeling_0.3 foreign_0.8-69
[23] bit_1.1-12 munsell_0.4.3
[25] shiny_1.0.5 broom_0.4.3
[27] compiler_3.4.3 httpuv_1.3.5
[29] modelr_0.1.1 pkgconfig_2.0.1
[31] mnormt_1.5-5 htmltools_0.3.6
[33] crayon_1.3.4 showtextdb_2.0
[35] grid_3.4.3 xtable_1.8-2
[37] nlme_3.1-131 jsonlite_1.5
[39] gtable_0.2.0 DBI_0.7
[41] magrittr_1.5 scales_0.5.0
[43] cli_1.0.0 stringi_1.1.6
[45] reshape2_1.4.2 bindrcpp_0.2
[47] xml2_1.1.1 rjson_0.2.15
[49] tools_3.4.3 showtext_0.5
[51] bit64_0.9-7 glue_1.2.0
[53] hms_0.4.0 parallel_3.4.3
[55] yaml_2.1.15 colorspace_1.3-2
[57] rvest_0.3.2 bindr_0.1
[59] haven_1.1.0
내게는 효과가 없습니다. 대신에 emojis가 흰색 사각형으로 나타나고, 출력으로 내 질문을 편집합니다. 그리고 내 infosession과 함께 : '( –
당신은 어떻게 얻을 수에 대한 자세한 정보를 제공 할 수 주시겠습니까? 그 RStudio 그 음모가 작동하지 못했습니다.하지만 .svg로 음모를 저장도 제대로 작동하지 않습니다 ... –
내 게시 된 접근 방식은 리눅스 컴퓨터에서 만들어졌지만 윈도우즈에서는 흰색 사각형도 얻었습니다 ... –