Using pch Characters in grid.text

半城伤御伤魂 提交于 2019-12-23 19:23:33

问题


I have created a graph using ggplot2. Now I want to have the legend not onto the graph but in the grid outside the graph.

My question is now if someone knows if there is a possibility to use the pch symbols in grid.text?

Here is an image to show what I want ;)

Best regards


回答1:


I don't know if we can directly use points in text, but you can combine grid.text and grid.points:

grid.points(x=rep(0.1,9),y=1:9/10,pch=1:10,default.units="npc")
grid.text(x=rep(0.2,9),y=1:9/10,label=letters[1:9],default.units="npc")


来源:https://stackoverflow.com/questions/4377031/using-pch-characters-in-grid-text

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!