Display a SERIES[REAL] value in a graph

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
alexecon
Posts: 72
Joined: Fri Oct 30, 2015 12:16 pm

Display a SERIES[REAL] value in a graph

Unread post by alexecon »

I have a SERIES[REAL] containing impulse responses and would like to display the first value (the own effect of the shock) in a graph showing the response of another variable (to the same shock). It is probably very straightforward to do but after a long day's work the law of diminishing returns has kicked in and cannot find how. Can you help with that? Many thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Display a SERIES[REAL] value in a graph

Unread post by TomDoan »

I'm not sure I understand what you're trying to do. Do you want to draw a horizontal line or something like that at the impact value?
alexecon
Posts: 72
Joined: Fri Oct 30, 2015 12:16 pm

Re: Display a SERIES[REAL] value in a graph

Unread post by alexecon »

I just want to display the actual numerical value of the shock somewhere in the graph. Do I do that with grtext?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Display a SERIES[REAL] value in a graph

Unread post by TomDoan »

Yes. Note that you have to wrap everything in an SPGRAPH. Something like

spgraph(footer="my graph")
graph(number=0)
# otherirf
grtext(position=upleft) "Shock="+%strval(myirf(1),"*.##")
spgraph(done)

will put the value of the first element of myirf(1) into the top left corner, formatted with two decimal places.
alexecon
Posts: 72
Joined: Fri Oct 30, 2015 12:16 pm

Re: Display a SERIES[REAL] value in a graph

Unread post by alexecon »

This is exactly what I needed. Thank you.
Post Reply