Search code examples
rplotaxis-labels

R - change size of axis labels with ROCR



I want to increase the size of the axis labels. The data contains ROC curves, drawn by ROCR.

library(ROCR)
# load the sample data and create an performance object
data(ROCR.hiv)
pp <- ROCR.hiv$hiv.svm$predictions
ll <- ROCR.hiv$hiv.svm$labels
par(mfrow=c(2,2)) 
pred<- prediction(pp, ll)
perf <- performance(pred, measure="tpr", x.measure = "fpr")

Some manipulations on the figure work, others, like setting cex.axis, not. Here's an example:

# try different manipulations
plot(perf) # normal layout
plot(perf, cex.axis=2) # no change 
plot(perf, col.axis="red") # no change 
plot(perf, col.main="red", cex.main=3, main="abc") # the header may be manipulated

it seems like cex.axis is not set correctly, because

plot(perf, cex.axis=2) 
par()

shows, that

$cex.axis
[1] 1

any ideas? Thank you!


Solution

  • Thanks to rawr I found the answer:

    par(cex.axis=2)
    plot(perf)