I am trying to add a ppp plot to a PDF file, and the text of the legend is getting cut off. The cex argument in the leg.args only changes the point size.
library(spatstat)
plot(hamster)
Or, if there is a better way to adjust the plot size to fit the paper, I am using Quarto.
To change the size of the text in the legend: use leg.args(cex.axis=<value>). (Sorry it is a bit hard to find. The help file for plot.ppp says that leg.args will be passed to plot.symbolmap. The help for plot.symbolmap says that extra arguments ... are passed to points ,symbols, or axis. The help for axis mentions the argument cex.axis. )
To change the white space: spatstat uses the base graphics system in R, which controls the amount of white space around a plot using the graphics parameter par("mar"). This defaults to c(5.1, 4.1, 4.1, 2.1) and is a vector of 4 numbers specifying space at the bottom, left, top and right, respectively. Try something like par(mar=rep(5.1, 4)) although in the example above you could probably use par(mar=0.1+c(1, 5, 3, 1)).
Prevent clipping: some base graphics functions have the side-effect that they reset the clipping region. To prevent this, type par(xpd=NA) immediately before calling plot.ppp.