0

I'm creating Bland Altman plots using the blandr and ggplot packages, I was previously using the BlandAltmanLeg package but switched due to difficulties in customing the axes in this package.

My issue is that after switching, setting the plot marker to its smallest possible setting using

geom_point(shape = ".")

renders with size greater than what I was previously using with base r

pch = "."

Which I believe is essentially meant to be the equivalent (single pixel), since I am plotting 2million + point, the greater size makes a considerable difference (see images).

Side by side comparison shows how much is lost through the size difference

SasCom
  • 47
  • 1
  • 7
  • 4
    `shape = "."` puts the shape as a period, not a single pixel, just like `shape = "&"` sets the point as the ampersand. If you want the period to be smaller, you need to set the `size` argument smaller. – teunbrand Jul 19 '21 at 21:01
  • Try without `shape=` and with `+geom_point(size = 0.1)` – M.Viking Jul 19 '21 at 21:19
  • Ok I didn't realise I need to specify size, this ggplot guide makes it sound like geom_point(shape = ".") will give a minimum size., https://ggplot2.tidyverse.org/reference/geom_point.html @M.Viking, thanks for the suggestion but seems to give the same result as before. – SasCom Jul 19 '21 at 22:09
  • After some experimenting I do not know the answer, looking at the source code I see this comment 'a "." to draw the smallest rectangle that is visible (i.e., about one pixel)' https://github.com/tidyverse/ggplot2/blob/87e9b85dd9f2a294f339d88a353d0c11c851489d/R/aes-linetype-size-shape.r – M.Viking Jul 20 '21 at 02:43
  • Maybe this is it... `ggplot(df, aes(x=x, y=y))+geom_point(shape=".")` (tiny points) is completely different from `ggplot(df, aes(x=x, y=y, shape="."))+geom_point()` (bigger poitns) – M.Viking Jul 20 '21 at 02:44

0 Answers0