简体   繁体   中英

R ggplot2 arrowheads with geom_text

I use geom_text to plot some text. A text example would be:

a -> 7.0

However, instead of using "->" as an arrowhead I would like to use an arrowhead symbole.

I found the package plotmath to be used with ggplot to plot symboles.

I am not sure if it wouldn't be easier to plot the text separated from the actual symbol and align them using different coordinates that are close together so that once plotted it looks like a single string.

You'll want to pass it as an expression and use the parse=TRUE option for geom_text . The geom_text documentation should provide you with enough to get going:

Plotmath with geom_text : link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM