如何在legend.margin
?
legend.box.margin
更改ggplot(dfr,aes(x=x,y=value,fill=variable))+
geom_bar(stat="identity")+
theme(legend.position="top",
legend.justification="right",
legend.margin=margin(0,0,0,0),
legend.box.margin=margin(0,0,0,0))
或myCount ['a','b'] ['1','2'] => ['a','b','b']
似乎无能为力。
myCount :: [Char] -> [Int] -> [Char]
myCount [] [] = []
myCount (x:xs) (y:ys) = replicate y x && myCount xs ys
答案 0 :(得分:9)
实际上,我认为你提到的选项会起作用。他们似乎对我有用;也许你没有输入适当的值。
看看这些2,看看我在说什么:
ggplot(dfr,aes(x=x,y=value,fill=variable))+
geom_bar(stat="identity")+
theme(legend.position="top",
legend.justification="right",
legend.margin=margin(0,0,0,0),
legend.box.margin=margin(-10,-10,-10,-10))
ggplot(dfr,aes(x=x,y=value,fill=variable))+
geom_bar(stat="identity")+
theme(legend.position="top",
legend.justification="right",
legend.margin=margin(0,0,0,0),
legend.box.margin=margin(10,10,10,10))