Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle changing xlim in plot.roc #8

Closed
xrobin opened this issue Jul 29, 2015 · 3 comments
Closed

Handle changing xlim in plot.roc #8

xrobin opened this issue Jul 29, 2015 · 3 comments
Assignees

Comments

@xrobin
Copy link
Owner

xrobin commented Jul 29, 2015

The following piece of code in plot.roc handling legacy.axis fails to rescale with xlim:

        lab.at <- seq(1, 0, -0.2)
        if (x$percent) 
            lab.at <- lab.at * 100
        lab.labels <- lab.at
        if (legacy.axes) 
            lab.labels <- rev(lab.labels)
@xrobin
Copy link
Owner Author

xrobin commented Jul 29, 2015

Should probably use something like

lab.at <- axTicks(side=1)

and ignore the percent case (auto dealt with by axTicks).

@xrobin xrobin closed this as completed in a0d3171 Jul 29, 2015
@xrobin
Copy link
Owner Author

xrobin commented Jul 29, 2015

Still need to fix the axis labels, as the current rounding is too harsh for small intervals. See

data(aSAH)
rocobj <- roc(aSAH$outcome, aSAH$ndka, percent=FALSE)
plot(rocobj, legacy.axes = TRUE)
plot(rocobj, legacy.axes = FALSE)
plot(rocobj, xlim = c(.8, .2), asp=NA, legacy.axes = TRUE)
plot(rocobj, xlim = c(.8, .2), asp=NA, legacy.axes = FALSE)
plot(rocobj, xlim = c(.8, .5), asp=NA, legacy.axes = TRUE)
plot(rocobj, xlim = c(.8, .5), asp=NA, legacy.axes = FALSE)

rocobj <- roc(aSAH$outcome, aSAH$ndka, percent=TRUE)
plot(rocobj, legacy.axes = TRUE)
plot(rocobj, legacy.axes = FALSE)
plot(rocobj, xlim = c(80, 20), asp=NA, legacy.axes = TRUE)
plot(rocobj, xlim = c(80, 20), asp=NA, legacy.axes = FALSE)
plot(rocobj, xlim = c(80, 50), asp=NA, legacy.axes = TRUE)
plot(rocobj, xlim = c(80, 50), asp=NA, legacy.axes = FALSE)

@xrobin xrobin reopened this Jul 29, 2015
@xrobin xrobin self-assigned this Jul 29, 2015
@xrobin
Copy link
Owner Author

xrobin commented Jul 30, 2015

Labels look OK now.

@xrobin xrobin closed this as completed Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant