# increasing distance between axis label and axis gbmplot

I would like to ask for help to find out how I can put more space between xlabel and the x axis... I read that I could use the mtext or mgp function, but I tried both and couldn't apply it properly, it was quite strange and it didn't work. I've been trying since yesterday and I can't. I would appreciate it very much for your help.

``````gbm.plot(ina, n.plots=3, write.title=FALSE, common.scale=FALSE, x.label = NULL,
cex.axis=1, las = 2, y.label = "fitted function",
smooth=TRUE, axes=T, plot.layout=c(1,3))
``````

Thanks

Here is a solutions using par("mar") and title().

``````X <-  10001:10005
Y <- 11:15
plot(X, Y, las = 2, xlab = "My Label")
``````

``````
plot(X, Y, las = 2, xlab = "")
title(xlab = "My Label", line = 4)
``````

``````
par("mar" = c(8, 4, 4, 2) + 0.1)
plot(X, Y, las = 2, xlab = "")
title(xlab = "My Label", line = 7)
``````

Created on 2020-06-18 by the reprex package (v0.3.0)

Hi, thanks for your help but unfortunally it wont worked... I dont know if it's because i use a gbm result, and its not data frame, so i cant plot a x and y axis, i have to insert the result of my analisis (gbm.step), and also its a 3 graphs at once. And I also want the standard legend of the x-axis to appear in the three graphs, as it appears in the graph I sent first. The only change would be to increase the distance between the label of the axis and the graphic, so that it is not overlapped.
so when i put your code, all i have is this:

``````par(mar = c(8, 4, 4, 2) + 0.1)
plot(ina, las = 2, xlab = "")
title(xlab = "NULL", line = 7)
``````

I am not familiar with the gbm.plot function. Could you use code like the example below but substituting gbm.plot() where I have plot() and setting gbm.plot to make only one plot at a time? That may be a crazy suggestion, I admit.

``````X <-  1:5
Y <- 1:5
par(mfrow = c(1,3))
par(mar = c(8, 4, 4, 2) + 0.1)
plot(X, Y, xlab = "", las = 2)
title(xlab = "First", line = 7)
plot(X, Y, xlab = "", las = 2, col = "red")
title(xlab = "Second", line = 7)
plot(X, Y, xlab = "", las = 2, col = "blue")
title(xlab = "Third", line = 7)
``````

Created on 2020-06-18 by the reprex package (v0.3.0)

Thank you so much for your time but it didnt work. I think its because iam using the gbm.plot. I dont know how to separate the plots so i can work in them separately... all I have is the result of the analis, which are all of them together.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.