Skip to content
Back to formatted view

Raw Message

Message-ID: <968880303.1115941.1632172911736@mail.yahoo.com>
Date: 2021-09-20T21:21:51Z
From: Kai Yang
Subject: ggplot2 bar chart: order display for each group

Hello List,

I submitted the code below, it will show two groups of avg_time bar chart for each gc_label.

ggplot(s8_GCtime, aes(fill=GTresult, y=avg_time, x=gc_label, label = avg_time)) +?
? geom_bar(position=position_dodge(), stat="identity") +
? geom_text(aes(label=avg_time), vjust=1.6, position = position_dodge(0.9), size=3.5)+
? theme(axis.text.x = element_text(angle = 45))


I found the ggplot put all of small value of avg_time on left side, bigger value of avg_time on right side for each gc_label. But I hope to control the order by GTresult. Could you tell me how to do this?

Thanks,
Kai

	[[alternative HTML version deleted]]