Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72762

Can an "if" qualifier be used to highlight specific markers in a scatter or connected plot?

$
0
0
I am wondering if there is a way to highlight a range of markers in either a scatter, connected, or xtline plot. For example:

sysuse xtline1, clear
xtset person day

Below, I am using twoway connected and limiting the days of observation. I want to change the marker to open circle if the days are between 24dec2002 and 26dec2002 (in this case, to highlight the spike).

twoway conn calories day if person ==1 & tin(20dec2002, 29dec2002), sort mcolor(black) lcolor(black) ///
msymbol (Oh if tin(24dec2002, 26dec2002)) ///
|| conn calories day if person ==2 & tin(20dec2002, 29dec2002), sort ///
|| conn calories day if person ==3 & tin(20dec2002, 29dec2002), sort ///
legend(order(1 "Tess" 2 "Sam" 3 "Arnold"))

note the "msymbol (Oh if tin(24dec2002, 26dec2002))" is where the issue is.

Thanks in advance!

Ariel

Viewing all articles
Browse latest Browse all 72762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>