strengejacke / sjPlot

sjPlot - Data Visualization for Statistics in Social Science
https://strengejacke.github.io/sjPlot
606 stars 91 forks source link

Setting y-axis limits for plot_model, type="pred" #890

Closed graziadipisa closed 1 year ago

graziadipisa commented 1 year ago

Hallo,

How can I set the y-axis limits for plot_model(m, type= “pred”)? My code is the following:

sjPlot::plot_model(model, type ="pred", terms = c("task", "group"))

which yields: 00000d

I would like the y-axis to start at 50% while now it starts at 95%.

Many thanks!

AlexGareau commented 1 year ago

plot <- sjPlot::plot_model(model, type ="pred", terms = c("task", "group")) plot <- plot + scale_y_continuous(limits = c(.5,1))

plot_model() are ggplot object that can be manipulated after the function.

graziadipisa commented 1 year ago

Thank you so much it worked! :)