Entering edit mode
3.0 years ago
USER
•
0
I would like to plot a graph like this
but the graph is coming out like this
![enter image description here][2]
code
p1 <- ggplot(df, mapping = aes(x = FK_codonRNA , y=tscore, fill = nomeOrganismo)) +
geom_boxplot() +
facet_wrap(~nomeOrganismo)
df
![enter image description here][3]
size df ![enter image description here][4]
What am I doing wrong? How can I solve this problem?
For starters, try switching to
facet_grid
, which gives you more control over the layout. Customizing ggplots is a step by step trial and error process (for me at least), so you may have to make changes one by one and experiment with different ways of making those changes.In your case, you'd need a custom
labeller
(I think) and you'd also need to set the width of each box or the entire plot somehow.in the absence of example data, try this: