Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: xtline: options for line color


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: xtline: options for line color
Date   Tue, 20 Jul 2010 23:06:51 +0200

<>

You may want to rephrase your question in terms of an example that is within
reach of Statalist users:


***********
sysuse xtline1, clear
xtline calories, overlay
***********

Scheme "sj" is black and white, so I do not understand how one could change
the "color" of a line in there...

HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Alison Drake
Sent: Dienstag, 20. Juli 2010 22:41
To: [email protected]
Subject: st: xtline: options for line color

I would like to change the color of lines for subgroups on a graph generated
by xtline.  I want to create an overlay of the lines by 2 different groups,
group 0 and 1 and have the lines for group 0 be one color and group 1 be
another color.  Currently, I can?t figure out how to change the line options
unless I use a scheme, and I haven?t been able to adjust the line options by
groups.

The code I am using now (which I have also added 2 lowess curves to) shows
the plasmaVL for each id using the sj scheme color (see below).  Can anyone
help me get different colors of lines by group? Instead of scheme(sj) I have
tried lcolor (green) to try to adjust the color for all, as well as lcolor
if group==0 or if group==1 without success.  I?m not sure this is possible
with xtline?

xtset idno visitno
xtline plasmaVL,   overlay legend(off) scheme(sj) xlabel(0(1)1)
title("Plasma HIV viral load over time, by treatment group")  ytitle("Log10
copies/mL") /*
*/ xtitle("Visit number")  addplot ((lowess plasmaVL visitno if group==0,
lcolor(blue) lpattern(solid) lwidth(thick))/*
*/(lowess plasmaVL visitno if group==1, lcolor(red) lpattern(solid)
lwidth(thick)))

Thanks,

Alison Drake, MPH
Pre-doctoral Fellow
Department of Epidemiology
University of Washington
Box 359909
Seattle, WA 98195-7236
phone: (206) 579-9211
email: [email protected]



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index