# Time-Series Plots

Gnuplot handles all the plotting in gretl. Gretl includes some functions that help to communicate with gnuplot, which makes things much easier to do. On the other hand, if you have something really fancy to plot, you may have to use gnuplot directly to get the desired result. All-in-all, gretl’s graphical interface that works with gnuplot is quite easy to use and powerful.

Gretl’s time-series plot is really just an XY scatter plot against time with the —lines option used to connect the data point. It’s relatively primitive. Clicking on a graph brings up a list of things you can do, including edit the graph. Clicking the edit button brings up the plot control dialog box (Figure 4.16) where substantial customization can be done.

Gretl also has a facility to plot multiple series in separate graphs that appear on the same page. This is accomplished using the scatters command or View>Multiple graphs>Time-series from the main menu bar. There is no built-in facility for further editing these graphs, but you can save them in several formats. Examples of this are found below.

Results

Quarterly data that start in 1990:1 Annual data starting in 1952 Monthly data starting in March, 1990 Daily data (5 day weeks) starting Jan. 6, 1950

Table 9.1: Data structure using setobs: Some examples for time-series

1 open "@gretldirdatapoeokun. gdt"

2 setinfo g – d "percentage change in U. S. Gross Domestic Product, seasonally

3 adjusted" – n "Real GDP growth"

4 setinfo u – d "U. S. Civilian Unemployment Rate (Seasonally adjusted)" – n

5 "Unemployment Rate"

6 gnuplot g —with-lines —time-series —output=c:tempokun_g. plt

7 gnuplot u —with-lines —time-series —output=c:tempokun_u. plt

The two plots are shown in Figure 9.3. The graphs can be combined using the GUI by choosing View>Multiple graphs>Time-series. The result appears in Figure 9.4. The gretl command to generate multiple series in multiple graphs is

scatters g u

## Leave a reply