3

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

x0 and y0 are just 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.

CodeGuy
  • 28,427
  • 76
  • 200
  • 317
  • possible duplicate of [Control the size of points in an R scatterplot?](http://stackoverflow.com/questions/2579995/control-the-size-of-points-in-an-r-scatterplot) – Ari B. Friedman Aug 20 '11 at 18:50

3 Answers3

6

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

joran
  • 169,992
  • 32
  • 429
  • 468
6

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

plot showing use of symbols()

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
3

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)

enter image description here

Paolo
  • 2,795
  • 1
  • 20
  • 23