我正在尝试根据我的数据(年和雨)生成折线图。该图很好,但是我想(自动)更改每条线的颜色。代码在下面给出
scale_fill_brewer(palette="Oranges")
我正在尝试使用
Error: Continuous value supplied to discrete scale
,但显示错误。 scale_fill_brewer(palette="Oranges")
。
我的没有java -Xmx256m -jar -Dspring.profiles.active=test /home/appuser/myapp.jar
的图表在下面给出
我需要像这样绘制(此图使用Python是精简的!)
你能告诉我,我该怎么做?
答案 0 :(得分:0)
尝试以下操作(由于缺少可重复的数据,因此未提供任何输出):
#Code
ggplot(data=data_1, aes(x=Year, y=rain, fill=factor(Year)))+
geom_line(stat="identity")+
theme_minimal()+
geom_col(width = 0.05, position = position_dodge(0.7))+
xlab("Year")+
ylab("Rain")+
ggtitle("Rain of every Year")+
guides(fill = guide_legend(ncol = 1))
答案 1 :(得分:0)