Changing oreintation of shapes for polar plots

Hi, I have some circular data and have a high density of data points which cluster around one region, so I'd like to use the '|' shape so it's easier to visualise all the points. Unfortunately the oreintation of the shape does not change dependent on where it is, so it looks strange (see reprex). Ideally I'd like for all the points to be pointing inward to the centre of the plot. So a '|' at 90/180 degree would be horizontal for example.

library(ggplot2)

df <- data.frame(
           x = seq(1:50),
           y = rep(1,50)
      )

ggplot(df, aes(x,y)) +
  geom_point(shape = 124, size = 5) +
  coord_polar() 

Created on 2020-04-02 by the reprex package (v0.3.0)

I think that the only thing available to work with is the shape argument:

library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg))
par(mfrow=c(2,2)) 
p + geom_point(shape = 5) + coord_polar()

p + geom_point(shape = "k", size = 3) + coord_polar()

p + geom_point(shape = ".") + coord_polar()

p + geom_point(shape = NA) + coord_polar()
#> Warning: Removed 32 rows containing missing values (geom_point).

Created on 2020-04-02 by the reprex package (v0.3.0)

Thanks @technocrat. I figured that might be my only choice but thought I'd check in case I was missing something :slight_smile: I ended up going with the '.' shape and a small amount of jitter.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.