Marker on the line

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Marker on the line

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Marker on the line

Unread post 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.
Post Reply