我想在我的ggplot(条形图)中使用RColorBrewer的“Oranges”调色板中更深的颜色,但我无法做到。 帮帮我。 下面是示例代码:
my_palette = brewer.pal(n = 9, "Oranges")[4:9]
### Bar Plots ###
ggplot(Sample_df, aes(x = Sample_Score), fill = Sample_Score) +
geom_bar(stat = "count", width = 0.8) + scale_fill_brewer(palette= my_palette) + scale_y_log10(labels = comma) +
labs(title="Distribution of customers according to Sample Score",x="Sample Score", y="Number of Customers") +
theme(plot.title = element_text(face = "bold", size = 10),
axis.title.x = element_text(face = "bold", size = 8),
axis.title.y = element_text(face = "bold", size = 8), legend.position="none")
Sample_df
。请阅读关于如何提出好问题和如何给出可重现的示例的信息。这将使其他人更容易地帮助您。 - Axeman