Page 1 of 1

Marker on the line

Posted: Fri Apr 07, 2017 4:50 pm
by msrahman
Hello,
I am graphing impulse response functions. On the lines, I want to use markers (for example a cross or something) to indicate if the responses are significant at a particular horizon.

Anybody has any idea how can I do that?

Sincerely,
Sajjadur Rahman

Re: Marker on the line

Posted: Sat Apr 08, 2017 2:12 pm
by TomDoan
One way I've seen something like this done is using a stacked bar graph with only one color active at each point. For instance, this will be black for the larger values and blue for the smaller ones:

compute nobs=50
set test 1 nobs = sin(.3*t)
set testblack 1 nobs = %if(abs(test)>0.7,test,%na)
set testblue 1 nobs = %if(abs(test)<=0.7,test,%na)
graph(style=stacked) 2
# testblack
# testblue

I've also seen background shading used for the significant segments.


STYLE=SYMBOLS isn't designed to mark specific locations (it's a line with occasional symbols to identify it). The only style that would work for marking specific locations is STYLE=DOTS. However, the dots are too small to be laid on top of a line---they're designed to be the one and only indicator of the series. You can see how something like:=

compute nobs=50
set test 1 nobs = sin(.3*t)
set testdot 1 nobs = %if(abs(test)>0.7,test,%na)
graph(style=line,overlay=dots,ovsamescale) 2
# test
# testdot / 5

works if you play with the styles a bit.