Thanks Kit for the line splitting problem. That is helpful.
But I'm sure you can't honestly be happy with leaving out that last observation. The issue is not whether it's the last observation or not. It could be in the middle. What about Line 2, it has an observation that's within the range. What if I've got line 3, 4, 5 as well which all have observations within range. I imagine that you might just leave out Line 1's outlying observation, but that's ambiguous - it suggests a missing value.
More often, it's not the point itself that's outside the range, but the error bar. I just flipped through a nature magazine (it's the only one I have), and found an example of this: Vol 452(7190): p.985, Fig 3. In fact, I guess one guage of how good a software's graphical capability is is to look through a journal and see how many of the graphs can be reproduced. Sometimes it's not whether you think the graph is sensible that counts - it's what the editor of the journal thinks.
Tim
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kit Baum
Sent: 26 January 2009 14:24
To: [email protected]
Subject: st: re: the future of statistical computing
<>
Timothy wrote
----------------
x <- 0:10
y <- c(1,1,1,1.5, 2,3,4,4,4.5,5,98)
y2 <- c(0,0,0.5,1.5,2,1.5,2,4,8,9,9)
plot(x,y,type="b",ylim=c(0,10), xlab="This is the number of days \n
since a particular day")
lines(x,y2,type="b",col="red")
legend(0,10,legend=c("Line 1","Line 2 is really long. So I'd like",
"to split it into two lines"),col=c("black","red","white"),lwd=1)
-----------------
I can run that with no problem in R. I do wonder, though, what it
means to have a vertical line segment for series y beyond the last
graphed point. I think it might be more sensible to graph only those
values which you want to see:
-----------------
clear
mata: mata clear
mata
st_matrix("y",(1,1,1,1.5, 2,3,4,4,4.5,5,98)')
st_matrix("y2",(0,0,0.5,1.5,2,1.5,2,4,8,9,9)')
end
set obs 11
g x = _n - 1 in 1/10
svmat y
svmat y2
twoway conn y1 y21 x if !mi(x), xti("This is the number of days"
"since a particular day") ///
lcolor(black red) msymb(Oh Oh) leg(ring(0) pos(10) col(1) lab(1 "Line
1") ///
lab(2 "Line 2 is really long." "So I'd like to split it into two
lines"))
----------------
As you can see it is no problem to split either axis labels or legend
keys into multiple lines. That is, I believe, a recent enhancement to -
graph-. It doesn't look much more complicated to produce the Stata
graph than the R graph.
Kit
Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html
*
* 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/