Reputation: 592
The following code produces the roc plot below. It seems to be ignoring the limits I've set on the axis. How can I get the plot to stop at 0 and 100?
roc(rdb$Engramcell,
rdb$ActivityScore,
plot=TRUE, legacy.axes=TRUE, percent=TRUE,
plot.window(xlim=c(100, 0),
ylim=c(0, 100)),
xlab="False Positive Percentage", ylab="True Postive Percentage",
col="firebrick4", lwd=1, print.auc=TRUE)
Upvotes: 0
Views: 205
Reputation: 7969
First, you didn't set the limits properly, you should pass xlim
and ylim
directly, not a call to plot.window
.
roc(...,
percent=TRUE,
xlim=c(100, 0),
ylim=c(0, 100)),
...)
But this wouldn't change your plot. By default, R extends the data range by around 4%. These margins are controlled by the xaxs
and yaxs
graphical parameters. Setting them to "i"
removes the margins:
library(pROC)
roc(aSAH$outcome, aSAH$ndka, plot=TRUE, xaxs="i", yaxs="i")
Upvotes: 0