[R] Space between axis title and tick labels in persp plot in R (using vis.gam)

j@de@shod@@ m@iii@g oii googiem@ii@com j@de@shod@@ m@iii@g oii googiem@ii@com
Wed Jul 6 19:22:09 CEST 2022

Dear list,

I am making a perspective plot of my generalised additive model (GAM)
named a1b, using vis.gam() in mgcv, which in turn makes use of the
persp function in base R.

Code is as follows:

vis.gam(x = a1b,
        view = c("wbgt_max", "lag"),
        plot.type = "persp",
        xlab = "max WBGT (°C)",
        ylab = "lag (days)",
        zlab = "deaths",
        theta = 60,
        phi = 15,
        r = sqrt(3),
        d = 1,
        type = "response",
        ticktype = "detailed")

The plot can be found here:

On the x and z-axes, the axis title and axis labels are plotted over each other.

I would like to:

1) increase the space between the axis titles and the tick labels for
the x and z- axes (WBGT and deaths) and
2) increase the space between the ticks and the tick labels.

I've looked up similar posts on StackOverflow, which suggest adding
the following code to the plot (and change the values for the
currently stated defaults):



vis.gam(x = a1b,
        view = c("wbgt_max", "lag"),

However, this changes nothing at all to the plot. (I tried with c(20,
20, 20) , smaller values and larger ones).

Would be grateful for any suggestions!


More information about the R-help mailing list