Any ideas on how to change the width of barplot bars with the function bargraph.CI()
from the sciplot
pacakge? I have a very simple barplot with 2 bars, and can't figure out how to slim them down. I've tried the argument, width, from the barplot()
function, but without any success. Thanks for your help!
Asked
Active
Viewed 1,621 times
0

thelatemail
- 91,185
- 12
- 128
- 188

user2096647
- 99
- 1
- 9
2 Answers
1
Try adjusting the space= argument. As the bar widths specified through width= are all relative, if you just specify one value they will never change size:
E.g.: both of the following give the same result:
bargraph.CI(x.factor = dose, response = len, data = ToothGrowth, width=1)
bargraph.CI(x.factor = dose, response = len, data = ToothGrowth, width=1000)
Adjusting space=
however, pushes the bars apart and indirectly affects their width:
bargraph.CI(x.factor = dose, response = len, data = ToothGrowth, space=1)
bargraph.CI(x.factor = dose, response = len, data = ToothGrowth, space=5)
To ultimately reduce the size of plots though, you might also look at pushing in the margins or reducing the size of the plotting device. See this previous question:
reducing the space between plotted points in plot( x, y) type=n
Then try something like:
par(mar=c(5.1,8,2.1,8))
bargraph.CI(x.factor = dose, response = len, data = ToothGrowth, space=c(1))

Community
- 1
- 1

thelatemail
- 91,185
- 12
- 128
- 188
0
barplot(1:3, width=1:3)
Works --> maybe give us your code to see what's wrong?

Hillary Sanders
- 5,778
- 10
- 33
- 50