Display a SERIES[REAL] value in a graph
Display a SERIES[REAL] value in a graph
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.
Re: Display a SERIES[REAL] value in a graph
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?
Re: Display a SERIES[REAL] value in a graph
I just want to display the actual numerical value of the shock somewhere in the graph. Do I do that with grtext?
Re: Display a SERIES[REAL] value in a graph
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.
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.
Re: Display a SERIES[REAL] value in a graph
This is exactly what I needed. Thank you.