在grid.text中使用pch字符 [英] Using pch Characters in grid.text

查看:146
本文介绍了在grid.text中使用pch字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ggplot2创建了一个图表。现在我想让图例不在图表上,而是在图表外的网格中。



现在我的问题是如果有人知道是否有可能使用pch

这是一张图片来显示我想要的内容;)



最好的问候

解决方案

我不知道我们是否可以直接在文本中使用点,但是您可以结合grid.text和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)


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

解决方案

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")

这篇关于在grid.text中使用pch字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆