开发者

R plot - make a big circle at a point

How can I make a point that is a big, NOT colored in circle?

x0 and y0 are just开发者_C百科 lists with 1 value.

So this just plots one value:

points(x=x0,y=y0,col="green",pch=16)

But the circle is sort of small, and it's colored in.


To make the single plotting character larger, use cex, as in:

points(x = x0, y = y0, col = "green", pch = 16, cex = 10)

Please read (even though it's kind of tedious) ?par for base graphics options.

EDIT

I suppose I should add (even though I agree this question is mostly a duplicate) that the second part of your question simply requires a different value for pch. Sounds like pch = 1 is what you want, but you can see lots of options via example("points").


Depending how big you the circles you want, you could also consider the symbols() function.

## from ?symbols
N <- nrow(trees)
with(trees, {
## Girth is diameter in inches
symbols(Height, Volume, circles = Girth/24, inches = FALSE,
        main = "Trees' Girth") # xlab and ylab automatically
})

R plot - make a big circle at a point


The package shape contains a collection of functions for plotting all kind of graphical shapes ( see vignette("shape") ). In your case:

install.packages("shape")
require("shape")
emptyplot(c(0, 1))
plotcircle(mid = c(0.5, 0.5), r = 0.25)

R plot - make a big circle at a point

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜