我有以下代码可以获取下面的附加图像,现在我正在寻找一种方法来消除那些白色条纹,或者至少使每行和每列的样式一致。是否有办法实现这个目标?(同时,这些白条纹是由什么引起的?)
ttfCountCompleted <- tibble(`Production Date` = c(rep(as.Date("2013-09-01"),4), rep(as.Date("2013-10-01"),4), rep(as.Date("2013-11-01"),4) ),
`Months in Service` = c(rep(1:4,3)),
`nServ` = 1:12)
textcol <- "black"
ggplot(ttfCountCompleted,
aes(x = `Production Date`,
y = `Months in Service`,
fill=`nServ`
)
)+
geom_tile()+
#remove extra space
scale_y_discrete(expand=c(0,0))+
#set base size for all font elements
theme_grey(base_size=10)+
theme(
#remove legend title
legend.title=element_blank(),
#remove legend margin
legend.spacing = grid::unit(0,"cm"),
#change legend text properties
legend.text=element_text(colour=textcol,size=7,face="bold"),
#change legend key height
legend.key.height=grid::unit(0.8,"cm"),
#set a slim legend
legend.key.width=grid::unit(0.2,"cm"),
#set x axis text size and colour
axis.text.x=element_text(size=10,colour=textcol),
#set y axis text colour and adjust vertical justification
axis.text.y=element_text(vjust = 0.2,colour=textcol),
#change axis ticks thickness
axis.ticks=element_line(size=0.4),
#change title font, size, colour and justification
#remove plot background
plot.background=element_blank(),
#remove plot border
panel.border=element_blank())