Hi Jack, this is something my not yet published package GPlotFun covers.
However, it still needs some work to be done before an initial release.
Its development is still left open -- just send some comments or
suggestions or pull quest in case you have some concrete ideas.
Best,
Artur
Am 17.05.19 um 17:15 schrieb Riccardo (Jack) Lucchetti:
Folks,
I need to generate a time-series picture with NBER-style recession
bands. This is very easy to do via the GUI, but not very much so from
a script. So I put together the following function, that has a few
flaws but gets the basic job done:
<hansl>
function void plot_with_band(list X, series band)
smpl X band --contiguous
scalar y0 = min(min(X))
scalar y1 = max(max(X))
scalar m = (y1+y0)/2
scalar w = (y1-y0)/1.5
series band_w = band ? w : 0
series band_c = band ? m : NA
band_c[$t1] = m
band_c[$t2] = m
plot X
options time-series with-lines
options band=band_c,band_w,1 band-style=fill
end plot --output=display
end function
### example
open AWM17
series band = (t > 1990:1) && (t<1994:4) || (t > 2000:1) &&
(t<2004:4)
list X = CAN_YEN URX
plot_with_band(X, band)
</hansl>
Now, I can see three possibilities:
* just add this example to the User's Guide * refine the function and
make it a function package
* enhance the gnuplot command and the plot block with special syntax
I would find number 3 preferable, if we weren't just before release,
and I don't really feel like pushing release ahead for this. But OTOH,
if we decide to put this off for gretl 2019c, then options 1 and 2 are
not really worthwhile, are they?
Ideas?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
_______________________________________________
Gretl-devel mailing list -- gretl-devel(a)gretlml.univpm.it
To unsubscribe send an email to gretl-devel-leave(a)gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/