I have the following plot where I need to get the blue bar (fail) to the top. I tried with order
but it is not making the expected change. What is the issue with the order?
ggplot(a, aes(fill=Var1, y=value, x=Var2, order("pass","fail")))
+geom_bar( stat="identity", position="fill") + labs(x = "Subject", y="Pass/Fail Percentage")
+ guides(fill=guide_legend(title="Result"))
This is my data
Var1 Var2 value
pass Maths 865
fail Maths 135
pass Reading 910
fail Reading 90
pass Writing 886
fail Writing 114