Horizontal bar plot + facet_grid

32 views
Skip to first unread message

teragene

unread,
Mar 16, 2009, 1:15:45 AM3/16/09
to ggplot2
Hi Guys! I posted this problem I have several times. Still I didn't
find a good solution for this.
I specify my problem below.

== Goal:
I want to plot "horizontal bar chart with facet_grid in scales "free"

== Sample Data:

name,grade,section
student1,56,A
student2,68,A
student3,58,A
student4,99,B
student5,46,C
student6,44,C
student7,34,C
student8,56,C
student9,76,C


== Code:

qplot(name, grade, data=test, geom="bar")+facet_grid(section ~ .,
scales="free")+coord_flip()


==Output

It dosen't seem "scalse=free". It is fixed scales. This works nicely
in vertical bar plot.
NOT in horizontal format.

==What I want or expected

I want to plot this with scale free format.


teragene



hadley wickham

unread,
Mar 16, 2009, 9:26:45 AM3/16/09
to teragene, ggplot2
On Mon, Mar 16, 2009 at 12:15 AM, teragene <shi...@gmail.com> wrote:
>
> Hi Guys! I posted this problem I have several times. Still I didn't
> find a good solution for this.

And as I responded, it's a bug in the interaction between coord_flip()
and scales="free" which I don't know how to resolve yet.

Hadley

--
http://had.co.nz/

Reply all
Reply to author
Forward
0 new messages