My issue is that I want to do a scatter plot and size the circles to a variable in the data. While I can make this happen (the variable needs to be rescaled for some reason), the image of the circles looks odd (like there is some pixelation happening) and the size of the dots in the legend also ends up distorted.
Any idea what gives? Data and code are below.
df_t<-structure(
list(
x = c(
0.271802325581395,
0.28416149068323,
0.300177619893428,
0.273542600896861,
0.277777777777778,
0.295302013422819
),
y = c(
0.783430232558139,
0.708074534161491,
0.810834813499112,
0.689088191330344,
0.766937669376694,
0.651006711409396
),
comp = 1:6,
mkt_share = c(
0.259953161592506,
0.241921204072598,
0.404237288135593,
0.276032315978456,
0.283212302434857,
0.125510940129839
)
),
.Names = c("x", "y", "comp", "mkt_share"),
row.names = c("p2", "p3", "p4", "p5", "p6", "p7"),
class = "data.frame"
)
ggplot(data=df_t, aes(x=x, y=y, label=round(y,2), color = as.factor(comp)))+
geom_point(size = df_t$mkt_share*50)+
geom_text(size=4, color="white")+
coord_cartesian(xlim = c(0, .4), ylim=c(.6,.9))