I am trying to plot predicted values for model containing an interaction. I would like to move the position of the x-axis values (factors) closer to the centre of the graph. Currently using sjPlot, plot_model()
function and I have tried using grid.breaks=
but this only works for numeric values. Furthermore, everything I try, the values seem to only plot along the major grid lines. Is there not a way to plot between major grid lines? Alternatively is there a way to do this in ggplot2?
TIA
library("sjPlot")
data("mtcars")
mtcars$gear <- factor(mtcars$gear)
mtcars <- subset(mtcars,!gear=="3")
mtcars$gear <- factor(mtcars$gear)
levels(mtcars$gear)
m_gear <- lm(mpg ~ gear*wt, data = mtcars)
plot_model(m_gear, type = "int", grid.breaks = 0.5)