在 R 中绘制区域外的绘制点 [英] Plot points outside plotting region in R

查看:55
本文介绍了在 R 中绘制区域外的绘制点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 R 中的绘图区域外添加点(星号).但是,以下代码只允许在绘图区域内添加点:

I want to add points(asterisks) outside the plotting region of a plot in R. However, the following code only allows points to be added inside the plotting region:

x = c(1:10)
y = c(1:10)
plot(x,y)
points(11, 7, pch = 8)

如何调整代码以允许将点绘制在绘图区域之外?

How can I adjust code to allow the point to be plotted outside the plotting region?

推荐答案

这个 所以帖子可能会有所帮助!这是关于传说的,但您可能可以根据自己的需要应用相同的方法.

This SO post might help! It's about legends, but you can probably apply the same method for what you want.

这对我有用:

> par(xpd=TRUE)
> x = c(1:10)
> y = c(1:10)
> plot(x,y)
> points(11, 7, pch = 8)

这篇关于在 R 中绘制区域外的绘制点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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