0

I know this is too much fine-tuning, but I wonder if it is possible to change the width of the line pch=21.

I am trying to draw plots for a limited space, and I am using small units. And when I use the pch=21 with fill=white, the line of the pch remains too this compared to the rest of the plot lines.

One option would be to plot with bigger units and then make the plot smaller using scaling in LATEX, but this is not really what I want to do.

Is it possible to modify the thickness of the line for pch=21?


ggplot(test, aes(x=roundedRealNumVehicles/2, y=1-value, colour=as.factor(t1-t0) ) ) +
  stat_summary(fun.y=mean, geom="line", alpha=0.85 ) + 
  stat_summary(fun.y=mean, geom="point", pch=21, fill="white", size=1, width=0.01, show_guide=F )
ggsave(path= "~/Desktop/pics/", file="test.pdf", width=9/1, height=6/1, units = "cm")

dput(test)

the units used in the ggsave are the tricky part

cross
  • 1,018
  • 13
  • 32
  • 2
    do you have a reproducing example? – Colonel Beauvel Sep 02 '15 at 12:28
  • I added the required data @ColonelBeauvel – cross Sep 02 '15 at 12:49
  • Do you want to make the line in this plot thicker than usual? That can be done through the `size` argument... I'm sorry, I'm not sure if I understand your third sentence correctly. – maj Sep 02 '15 at 13:02
  • @maj no, it is not the line in the plot the one that I want to change, but the line surrounding the plotted points. – cross Sep 02 '15 at 14:20
  • In the development version of ggplot2 it looks like there is now a `stroke` argument to change the border thickness of points. – aosmith Sep 02 '15 at 14:50
  • 2
    possible duplicate of [Control point border thickness in ggplot](http://stackoverflow.com/questions/19506630/control-point-border-thickness-in-ggplot) – aosmith Sep 02 '15 at 14:51

1 Answers1

1

I don't know how to modify the thickness of pch21 (my guess would be it's an inherent part of the figure), but you could approach it in another way: plot two dots of different sizes on top of each other (largest first) and play around with their sizes until you're satisfied.

ggplot(test, aes(x=roundedRealNumVehicles/2, y=1-value, colour=as.factor(t1-t0) ) ) +
  stat_summary(fun.y=mean, geom="line", alpha=0.85 ) + 
  stat_summary(fun.y=mean, geom="point", color="red", size=1, width=0.01, show_guide=F )+
  stat_summary(fun.y=mean, geom="point", color="white", size=0.2, width=0.01, show_guide=F )

enter image description here

Heroka
  • 12,889
  • 1
  • 28
  • 38