Closed mworni closed 12 years ago
I'm not entirely sure I understood what you want to do, but here is some code without those labels:
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) summary(surv2) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", label.curves = FALSE)
?survplot will give you the following:
label.curves: default is TRUE to use labcurve to label curves where they are farthest apart. Set label.curves to a list to specify options to labcurve, e.g., label.curves=list(method="arrow", cex=.8). These option names may be abbreviated in the usual way arguments are abbreviated. Use for example label.curves=list(keys=1:5) to draw symbols (as in pch=1:5 - see points) on the curves and automatically position a legend in the most empty part of the plot. Set label.curves=FALSE to suppress drawing curve labels. The col, lty, lwd, and type parameters are automatically passed to labcurve, although you can override them here. To distinguish curves by line types and still have labcurve construct a legend, use for example label.curves=list(keys="lines"). The negative value for the plotting symbol will suppress a plotting symbol from being drawn either on the curves or in the legend.
On Sun, Jul 29, 2012 at 8:19 AM, mworni < reply@reply.github.com
wrote:
Ricardo - I tried to draw a nice KM-curve. I was able to get pretty far with what I was expecting but now I'm struggling with labeling the graph.
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", legend.text=c("Esophagectomy", "Local therapy")) legend(31, 0.4, c("Esophagectomy", "Local therapy"), lty=c(1,2), col=c(1,4))
Given this code - I would like to get rid of the labeling in the graph: "therapy=esophagectomy" and "therapy=local therapy" for both, the number of patients at risk as well as for the survival curve itself. How to do this?
You should have the script on your gdrive and the coding for the survival curve is at the very end (starting at line 116). Maybe, you will have to install the "rms" package.
Thanks, Mathias
Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/8
this works actually.
What I don't want to have either in the figure is the grey shading behind the survival curves (most likely some 95% CI) as well as the text "therapy=Esophagectomy" and "therapy=Local" behind the number of patients at risk. Instead, I would like to have the numbers of patients at risk in color black and blue.
Any idea on how to do this?
On Mon, Jul 30, 2012 at 6:37 AM, Ricardo Pietrobon < reply@reply.github.com
wrote:
I'm not entirely sure I understood what you want to do, but here is some code without those labels:
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) summary(surv2) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", label.curves = FALSE)
?survplot will give you the following:
label.curves: default is TRUE to use labcurve to label curves where they are farthest apart. Set label.curves to a list to specify options to labcurve, e.g., label.curves=list(method="arrow", cex=.8). These option names may be abbreviated in the usual way arguments are abbreviated. Use for example label.curves=list(keys=1:5) to draw symbols (as in pch=1:5 - see points) on the curves and automatically position a legend in the most empty part of the plot. Set label.curves=FALSE to suppress drawing curve labels. The col, lty, lwd, and type parameters are automatically passed to labcurve, although you can override them here. To distinguish curves by line types and still have labcurve construct a legend, use for example label.curves=list(keys="lines"). The negative value for the plotting symbol will suppress a plotting symbol from being drawn either on the curves or in the legend.
On Sun, Jul 29, 2012 at 8:19 AM, mworni < reply@reply.github.com
wrote:
Ricardo - I tried to draw a nice KM-curve. I was able to get pretty far with what I was expecting but now I'm struggling with labeling the graph.
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", legend.text=c("Esophagectomy", "Local therapy")) legend(31, 0.4, c("Esophagectomy", "Local therapy"), lty=c(1,2), col=c(1,4))
Given this code - I would like to get rid of the labeling in the graph: "therapy=esophagectomy" and "therapy=local therapy" for both, the number of patients at risk as well as for the survival curve itself. How to do this?
You should have the script on your gdrive and the coding for the survival curve is at the very end (starting at line 116). Maybe, you will have to install the "rms" package.
Thanks, Mathias
Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/8
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7360122
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
not sure this is possible. i'm jumping into a bunch of meetings right now, but you migth want to check all the options within survplot for alternatives. for example:
y.n.risk When n.risk=TRUE, the default is to place numbers of patients at risk above the x-axis. You can specify a y-coordinate for the bottom line of the numbers using y.n.risk.
On Mon, Jul 30, 2012 at 8:13 AM, mworni < reply@reply.github.com
wrote:
this works actually.
What I don't want to have either in the figure is the grey shading behind the survival curves (most likely some 95% CI) as well as the text "therapy=Esophagectomy" and "therapy=Local" behind the number of patients at risk. Instead, I would like to have the numbers of patients at risk in color black and blue.
Any idea on how to do this?
On Mon, Jul 30, 2012 at 6:37 AM, Ricardo Pietrobon < reply@reply.github.com
wrote:
I'm not entirely sure I understood what you want to do, but here is some code without those labels:
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) summary(surv2) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", label.curves = FALSE)
?survplot will give you the following:
label.curves: default is TRUE to use labcurve to label curves where they are farthest apart. Set label.curves to a list to specify options to labcurve, e.g., label.curves=list(method="arrow", cex=.8). These option names may be abbreviated in the usual way arguments are abbreviated. Use for example label.curves=list(keys=1:5) to draw symbols (as in pch=1:5 - see points) on the curves and automatically position a legend in the most empty part of the plot. Set label.curves=FALSE to suppress drawing curve labels. The col, lty, lwd, and type parameters are automatically passed to labcurve, although you can override them here. To distinguish curves by line types and still have labcurve construct a legend, use for example label.curves=list(keys="lines"). The negative value for the plotting symbol will suppress a plotting symbol from being drawn either on the curves or in the legend.
On Sun, Jul 29, 2012 at 8:19 AM, mworni < reply@reply.github.com
wrote:
Ricardo - I tried to draw a nice KM-curve. I was able to get pretty far with what I was expecting but now I'm struggling with labeling the graph.
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", legend.text=c("Esophagectomy", "Local therapy")) legend(31, 0.4, c("Esophagectomy", "Local therapy"), lty=c(1,2), col=c(1,4))
Given this code - I would like to get rid of the labeling in the graph: "therapy=esophagectomy" and "therapy=local therapy" for both, the number of patients at risk as well as for the survival curve itself. How to do this?
You should have the script on your gdrive and the coding for the survival curve is at the very end (starting at line 116). Maybe, you will have to install the "rms" package.
Thanks, Mathias
Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/8
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7360122
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7366682
this might sound silly, but could you draw what you have in mind like we do for a QD. i'm just having a hard time visualizing it. with your drawing in mind then we can look for the closest possible match
if you don't have an ipad, then just draw on a piece of paper (in color) and upload the picture
On Mon, Jul 30, 2012 at 12:10 PM, Mathias Worni mathias.worni@duke.eduwrote:
two little things missing - how to make the number of patients at risk in color and how to delete the labeling of the two lines with number of patients at risk...
On Mon, Jul 30, 2012 at 3:03 PM, Ricardo Pietrobon < reply@reply.github.com
wrote:
not sure this is possible. i'm jumping into a bunch of meetings right now, but you migth want to check all the options within survplot for alternatives. for example:
y.n.risk When n.risk=TRUE, the default is to place numbers of patients at risk above the x-axis. You can specify a y-coordinate for the bottom line of the numbers using y.n.risk.
On Mon, Jul 30, 2012 at 8:13 AM, mworni < reply@reply.github.com
wrote:
this works actually.
What I don't want to have either in the figure is the grey shading behind the survival curves (most likely some 95% CI) as well as the text "therapy=Esophagectomy" and "therapy=Local" behind the number of patients at risk. Instead, I would like to have the numbers of patients at risk in color black and blue.
Any idea on how to do this?
On Mon, Jul 30, 2012 at 6:37 AM, Ricardo Pietrobon < reply@reply.github.com
wrote:
I'm not entirely sure I understood what you want to do, but here is some code without those labels:
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) summary(surv2)
survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", label.curves = FALSE)
?survplot will give you the following:
label.curves: default is TRUE to use labcurve to label curves where they are farthest apart. Set label.curves to a list to specify options to labcurve, e.g., label.curves=list(method="arrow", cex=.8). These option names may be abbreviated in the usual way arguments are abbreviated. Use for example label.curves=list(keys=1:5) to draw symbols (as in pch=1:5 - see points) on the curves and automatically position a legend in the most empty part of the plot. Set label.curves=FALSE to suppress drawing curve labels. The col, lty, lwd, and type parameters are automatically passed to labcurve, although you can override them here. To distinguish curves by line types and still have labcurve construct a legend, use for example label.curves=list(keys="lines"). The negative value for the plotting symbol will suppress a plotting symbol from being drawn either on the curves or in the legend.
On Sun, Jul 29, 2012 at 8:19 AM, mworni < reply@reply.github.com
wrote:
Ricardo - I tried to draw a nice KM-curve. I was able to get pretty far with what I was expecting but now I'm struggling with labeling the graph.
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", legend.text=c("Esophagectomy", "Local therapy")) legend(31, 0.4, c("Esophagectomy", "Local therapy"), lty=c(1,2), col=c(1,4))
Given this code - I would like to get rid of the labeling in the graph: "therapy=esophagectomy" and "therapy=local therapy" for both, the number of patients at risk as well as for the survival curve itself. How to do this?
You should have the script on your gdrive and the coding for the survival curve is at the very end (starting at line 116). Maybe, you will have to install the "rms" package.
Thanks, Mathias
Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/8
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7360122
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7366682
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7367611
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
I did send you the figure to your regular email for visualization. It will be clear in a second what I mean when you see the figure.
On Mon, Jul 30, 2012 at 6:48 PM, Ricardo Pietrobon pietr007@gmail.comwrote:
this might sound silly, but could you draw what you have in mind like we do for a QD. i'm just having a hard time visualizing it. with your drawing in mind then we can look for the closest possible match
if you don't have an ipad, then just draw on a piece of paper (in color) and upload the picture
On Mon, Jul 30, 2012 at 12:10 PM, Mathias Worni mathias.worni@duke.eduwrote:
two little things missing - how to make the number of patients at risk in color and how to delete the labeling of the two lines with number of patients at risk...
On Mon, Jul 30, 2012 at 3:03 PM, Ricardo Pietrobon < reply@reply.github.com
wrote:
not sure this is possible. i'm jumping into a bunch of meetings right now, but you migth want to check all the options within survplot for alternatives. for example:
y.n.risk When n.risk=TRUE, the default is to place numbers of patients at risk above the x-axis. You can specify a y-coordinate for the bottom line of the numbers using y.n.risk.
On Mon, Jul 30, 2012 at 8:13 AM, mworni < reply@reply.github.com
wrote:
this works actually.
What I don't want to have either in the figure is the grey shading behind the survival curves (most likely some 95% CI) as well as the text "therapy=Esophagectomy" and "therapy=Local" behind the number of patients at risk. Instead, I would like to have the numbers of patients at risk in color black and blue.
Any idea on how to do this?
On Mon, Jul 30, 2012 at 6:37 AM, Ricardo Pietrobon < reply@reply.github.com
wrote:
I'm not entirely sure I understood what you want to do, but here is some code without those labels:
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) summary(surv2)
survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", label.curves = FALSE)
?survplot will give you the following:
label.curves: default is TRUE to use labcurve to label curves where they are farthest apart. Set label.curves to a list to specify options to labcurve, e.g., label.curves=list(method="arrow", cex=.8). These option names may be abbreviated in the usual way arguments are abbreviated. Use for example label.curves=list(keys=1:5) to draw symbols (as in pch=1:5 - see points) on the curves and automatically position a legend in the most empty part of the plot. Set label.curves=FALSE to suppress drawing curve labels. The col, lty, lwd, and type parameters are automatically passed to labcurve, although you can override them here. To distinguish curves by line types and still have labcurve construct a legend, use for example label.curves=list(keys="lines"). The negative value for the plotting symbol will suppress a plotting symbol from being drawn either on the curves or in the legend.
On Sun, Jul 29, 2012 at 8:19 AM, mworni < reply@reply.github.com
wrote:
Ricardo - I tried to draw a nice KM-curve. I was able to get pretty far with what I was expecting but now I'm struggling with labeling the graph.
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", legend.text=c("Esophagectomy", "Local therapy")) legend(31, 0.4, c("Esophagectomy", "Local therapy"), lty=c(1,2), col=c(1,4))
Given this code - I would like to get rid of the labeling in the graph: "therapy=esophagectomy" and "therapy=local therapy" for both, the number of patients at risk as well as for the survival curve itself. How to do this?
You should have the script on your gdrive and the coding for the survival curve is at the very end (starting at line 116). Maybe, you will have to install the "rms" package.
Thanks, Mathias
Reply to this email directly or view it on GitHub: https://github.com/rpietro/EsophagealCancerT1N0/issues/8
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7360122
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7366682
Reply to this email directly or view it on GitHub:
https://github.com/rpietro/EsophagealCancerT1N0/issues/8#issuecomment-7367611
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
Mathias Worni, MD, MHS Consulting Associate in Surgery Department of Surgery Duke University Medical Center
Ricardo - I tried to draw a nice KM-curve. I was able to get pretty far with what I was expecting but now I'm struggling with labeling the graph.
surv2 <- survfit(Surv(survivaltimerecodetotalofmonths, r_css) ~ therapy) survplot(surv2, cex=0.8, lwd=c(1,2), lty=c(1,3), col=c("black", "blue"), n.risk=TRUE, srt.n.risk=0, adj.n.risk=0.4, xlab="time in months", ylab="survival probability", legend.text=c("Esophagectomy", "Local therapy")) legend(31, 0.4, c("Esophagectomy", "Local therapy"), lty=c(1,2), col=c(1,4))
Given this code - I would like to get rid of the labeling in the graph: "therapy=esophagectomy" and "therapy=local therapy" for both, the number of patients at risk as well as for the survival curve itself. How to do this?
You should have the script on your gdrive and the coding for the survival curve is at the very end (starting at line 116). Maybe, you will have to install the "rms" package.
Thanks, Mathias