Using pch characters in grid.text

I created a graph using ggplot2. Now I want the legend not to be on the chart, but out of the chart in the grid.

My question is now, if anyone knows if there is a possibility to use pch characters in grid.text?

Here is an image to show what I want;) alt text

Regards

+3
source share
1 answer

I don’t know if we can directly use points in the 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")
+2
source

Source: https://habr.com/ru/post/1778959/


All Articles