I'm having trouble getting the axis labels to fit properly on my facetted radial plots. I can't really
I use the coord_radar function to create straight lines around the radial plot:
function(theta='x', start=0, direction=1){
# input parameter sanity check
match.arg(theta, c('x','y'))
ggproto(
NULL, CoordPolar,
theta=theta, r=ifelse(theta=='x','y','x'),
start=start, direction=sign(direction),
is_linear=function() TRUE)
}
Then here's my graph:
ggplot(VGR.mpre, aes(y=value, x=variable.2, group=factor(X), colour=Impaired.Task.Score))+
geom_polygon(fill = NA)+
geom_path(aes(group=factor(X)))+
geom_point()+
coord_radar()+
labs(x="Parameters", y="Z-score", title="Pre-op parameters for Visually Guided Reaching Task")+
scale_colour_manual(name="Impaired (Task Score > 1.96)", labels=c("No", "Yes"), values=c("#619CFF", "#F8766D"))+
theme(axis.text.x = element_text(face = VGR.mpre$face))+
facet_wrap(.~factor(X), nrow=2)+
theme_bw(base_size=25)+
theme(legend.position="bottom", legend.box="horizontal")
When I export the image, some of the axis labels are always cut off. This is a screenshot of the graph. "No Movement end" for example is cut off. I've tried using white space \n for the labels which worked for some of them, but I'm really wondering if there's a function that adjusts the amount of space between the panel borders and the graph itself. I can't seem to find the answer anywhere else on stack overflow, but if someone could link me to a similar question and/or help me out that would be super appreciated!!