Entering edit mode
3.4 years ago
Utkarsha
•
0
I am trying to create a bubble plot in R but I am getting blurry outline. I need the bubbles to be solid filled and distinct boundary. my code is:
library(ggplot2)
# creating data set columns
x <- c (0,0,0,0)
y <- c(6,5,4,1)
r <- c(1586,106,452,2017)
color <- c(1,2,3,6)
cbp1 <- c("violet", "violetred3", "violetred3", "magenta3")
sizeRange <- c(10,30)
# creating the dataframe from the above
# columns
data <- data.frame(x, y, r, color)
ggplot(data, aes(x = x, y = y,size = r,fill = r, color=as.factor(color))) +
ylim(-0.5,6.5) +
#geom_point(alpha = 0.7) + scale_color_brewer(palette="Dark2") +
geom_point(alpha = 0.7) + scale_color_manual(values = cbp1) +
scale_size(range = sizeRange, name="index") +
theme_minimal() +
theme(
legend.position = "none",
axis.text = element_blank(),
axis.title = element_blank(),
panel.grid = element_blank(),
)
Problem is not clear. Please post the image.