0

I tried to use the following to reduce the point size. But I don't see it changed. How to reduce the point size when qplot is used?

R> qplot(1:10, 1:10)+geom_point(size=.01)

Increasing point size works. I am not sure why increasing works but decreasing does not work.

R> qplot(1:10, 1:10)+geom_point(size=10)
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
user1424739
  • 11,937
  • 17
  • 63
  • 152
  • Try this `qplot(1:10, 1:10, size=1) + scale_size_continuous(range=c(0,0.1))`; change point size acting on the second element of `range` (in the example above is `0.1`) – Marco Sandri Aug 13 '21 at 15:45
  • How to disable the legend showing the size? Why this syntax is so verbose? Is there a more concise way to make the plot in ggplot2? The basic graphics syntax R is quite simple `plot(1:10, 1:10, cex = .1)`. I'd expect ggplot2 to be not so verbose, otherwise, there is no point of using it in my case. – user1424739 Aug 13 '21 at 16:19

1 Answers1

1

Have you considered using ggplot instead?

tibble(
        x = 1:10,
        y = 1:10
) %>% ggplot(mapping = aes(x, y)) + 
        geom_point(size = 0.1, show.legend = FALSE)

Compared to base::plot it is verbose as you say, but in the end it is actually more simple, and flexible. This is at least my experience!

Serkan
  • 1,855
  • 6
  • 20
  • This is even more verbose. This verbosity many be useful for complicated cases. But I don't think it makes sense for a simple plot like this. Also, for complicated cases, I do think a less verbose syntax could have been made. But unfortunately, many programmers in R didn't have such a mind set so that we end up with this level of verbosity. The use of operator like '%>%' was a late introduction, which just proves this point. – user1424739 Aug 14 '21 at 11:47
  • This is actually a quite interesting discussion, that Id wish we could have here!!!! – Serkan Aug 14 '21 at 15:53
  • Because, I obviously disagree with what you say, and are quite interested in your point about the pipe op that I clearly missed – Serkan Aug 14 '21 at 15:54
  • Here is something discussion about the pipe operator. https://stackoverflow.com/questions/38880352/should-i-avoid-programming-packages-with-pipe-operators It should not have been introduced in the first place. If you want to use pipe operators use it in language made with it in mind (like bash), not to use it in a language like an afterthought. – user1424739 Aug 14 '21 at 15:59
  • This is superinteresting actually! And yes, Im an average statistical programmer and not a ‘real’ programmer! – Serkan Aug 14 '21 at 17:34