While trying to visualise some data, I encountered the challenge to display circular barplots in a scatterplot.
Being used to ggplot2, I'm able to draw circular barplots, a scatterplot, but was not able to find a way to combine both of them.
I'd like to replace the points in the scatterplot, by the circular barplots.
Any ideas? Maybe another library?
Below a sample code:
library(ggplot2)
df1 <- structure(list(P = c(1L, 1L, 1L, 2L, 2L, 2L),
A = c(2L, 2L, 2L, 4L, 4L, 4L),
B = c(2L, 2L, 2L, 3L, 3L, 3L),
C = c(1L, 2L, 3L, 1L, 2L, 3L),
D = c(1L, 3L, 1L, 4L, 5L, 1L)),
row.names = c(NA,-6L), class = "data.frame")
scatter_plot <- ggplot(df1, aes(x=A, y=B)) +
geom_point()
circular_barplot <- ggplot(df1, aes(x=C,y=D)) +
geom_bar(stat="identity") +
coord_polar(start=0) +
facet_wrap(~P)


