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:

bar plot screenshot

notice how there no space between bars. however, when exporting figure pdf, either

  1. via quartz.save('file.pdf', type = 'pdf') or
  2. via pdf('file.pdf', type = 'pdf') followed barplot(…)

the output looks this:

bar plot pdf export

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() 

enter image description here


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -