r - Remove spaces around bars in PDF output -
i have bar plot:
> data = c(1, 5, 3, 4) > barplot(data, space = 0, col = 'gray', border = 0)
on os x, using default driver (quartz), looks this:
notice how there no space between bars. however, when exporting figure pdf, either
- via
quartz.save('file.pdf', type = 'pdf')
or - via
pdf('file.pdf', type = 'pdf')
followedbarplot(…)
the output looks this:
there discernible lines between bars. unfortunately, in case more aesthetic nuisance: i’m plotting lot of pixel-thin bars, , space between bars big bars themselves, changes perception of plot drastically.
is there way rid of lines in output? preferably when using pdf
device rather pdf quartz
output?
this should work:
barplot(data, space = 0, col = 'gray', border = 'gray')
edit: extended answer.
if define color of border same fill, should work. following code produces plot below:
data = c(1, 5, 3, 4) pdf('file.pdf') barplot(data, space = 0, col = 'gray', border = 'gray') dev.off()
Comments
Post a Comment