[英]Special symbols in ggvis
我正在繪制一個相當典型的地球化學剖面圖,為此我需要在x軸上使用下標和希臘符號
它應顯示為CH4(umol),其中4是下標,而u是希臘符號mu
ggvis代碼:
ch4 %>% ggvis(~ch4_umol, ~depth_cm, fill=~Core, stroke=~Core) %>%
layer_lines(fillOpacity=0) %>% scale_numeric('y', reverse=T) %>%
add_axis("y", title = "Depth (cm)") %>%
add_axis('x', orient='top', title="CH[4] ("mu "mol)")
旁注:我知道我可以在ggplot2中制作適當的標簽,但不能將x軸放在ggplot2的頂部
library(ggvis)
title <- "CH\u2084 (\u03BC mol)"
mtcars %>%
ggvis(~wt, ~mpg) %>%
layer_points() %>%
add_axis('x', orient = 'top', title = title)
如果將來需要更多特殊字符,請在此處查找並查找“ C / C ++ / Java源代碼”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.