I'm trying to do a bar plot of systolic (S) and diastolic (D) blood pressure values for three groups (1,2,3). I converted the dataset to long form so I have one variable type of measurement (levels: S1, D1, S2, D2, S3, D3) and variable of the values for each. I added a column for the groups (1,2,3) so I could get a separate bar for each group (fill=group in the aes). That produced a graph with all the bars equally spaced, so I added another variable S and D, with S for all S1, S2, S3 and same for D so I could use facet_wrap to get better separation of the S and D bars (that seems to be the only way). But now the D facet leaves a spaces for the S1, S2, S3 with value = 0, and same in reverse for the S facet. If you still follow all this, how can I get rid of those levels with value=0 in the facets?
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Can you please make a reproducible example?Cheers,Roman
On Fri, Jul 28, 2017 at 10:59 AM, j0hnCathey <jtca...@gmail.com> wrote:
I'm trying to do a bar plot of systolic (S) and diastolic (D) blood pressure values for three groups (1,2,3). I converted the dataset to long form so I have one variable type of measurement (levels: S1, D1, S2, D2, S3, D3) and variable of the values for each. I added a column for the groups (1,2,3) so I could get a separate bar for each group (fill=group in the aes). That produced a graph with all the bars equally spaced, so I added another variable S and D, with S for all S1, S2, S3 and same for D so I could use facet_wrap to get better separation of the S and D bars (that seems to be the only way). But now the D facet leaves a spaces for the S1, S2, S3 with value = 0, and same in reverse for the S facet. If you still follow all this, how can I get rid of those levels with value=0 in the facets?
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.