1

Is there a way ONLY to make the pch symbols bigger using this piece of code? I cant seem to figure this out.

plot(1)
legend("topright", legend=c(1,2,3,4,5,6),
       pch=c(20), col=c("red", "yellow", "green", "violet", "skyblue", "cyan"),
       title="number of studies", pt.cex=1.2)

enter image description here

rawr
  • 20,481
  • 4
  • 44
  • 78
Genetics
  • 279
  • 2
  • 11
  • 3
    Can you expand your question? Running your current code doesn't plot anything. – Heroka Jan 11 '16 at 15:58
  • I didnt think all the other code was important, but here you go. – Genetics Jan 11 '16 at 16:04
  • 3
    Sorry, I should have reformulated that. I meant 'please provide some [minimal] code that shows the problem you're having. Extra resource: [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Heroka Jan 11 '16 at 16:06
  • Heroka, The problem is that the legend pch dots are to small. I only want to increase those. If I run cex=1.5, the whole legend gets bigger. I_ONLY_want to increase pch setting in the legend. – Genetics Jan 11 '16 at 16:08
  • 3
    Is there a reason pt.ces doesn't do the job? When I set it to 10 (or3) everything else remains unchanged – Heroka Jan 11 '16 at 16:12
  • perfect Heroka, I didnt see the pt.cex function in legend. Sorry to bother you. – Genetics Jan 11 '16 at 16:14
  • 1
    Someone (OP or @Heroka) post `pt.cex` as a (short) answer? – Ben Bolker Jan 11 '16 at 16:31
  • if your question is only about one parameter of `legend`, there is no need to post all the code you have, you only need that which reproduces your problem in as few lines as possible – rawr Jan 11 '16 at 16:38
  • will do in the future rawr, thanks – Genetics Jan 11 '16 at 16:39

1 Answers1

7

You can set pt.cex inside legend to enlarge the points.

Heroka
  • 12,889
  • 1
  • 28
  • 38