SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Thu, 19 Jul 2012 16:20:44 +0000Making nice figureshttp://community.econometrics.com/question/237/making-nice-figures/Hi all,
It is often we need to use two y-axes to illustrate how two variables develop over a given time period. Let’s say we have two variables y(t) and x(t) for the time period t to T and want to use two y-axes. **Question:** Is it possible to make a graph (use the graph-function) in Shazam to plot a figure with two y-axes where for example y(t) is referred to the left y(t)-axis and x(t) to the right y-axis?
Best regards.
Tue, 17 Jul 2012 08:56:57 +0000http://community.econometrics.com/question/237/making-nice-figures/Answer by SHAZAMHelp for <p>Hi all,</p>
<p>It is often we need to use two y-axes to illustrate how two variables develop over a given time period. Let’s say we have two variables y(t) and x(t) for the time period t to T and want to use two y-axes. <strong>Question:</strong> Is it possible to make a graph (use the graph-function) in Shazam to plot a figure with two y-axes where for example y(t) is referred to the left y(t)-axis and x(t) to the right y-axis?</p>
<p>Best regards.</p>
http://community.econometrics.com/question/237/making-nice-figures/?answer=326#post-id-326Some of the graphs produced by the financial functions PORT and STOCK do this automatically. To do this with the GRAPH command you can easily edit the graph script from the 'Edit Source' button on the Graph Viewer to do this yourself - adding using the 'Edit Data' button should you need to.
Here is a simple example where we both add data, y axes labels and a second axis by hand to an existing graph.
1) Open SHAZAM 11 and then open the 'Introduction' on the Help menu.
2) Open the Dynamic VAR.gnu Graph and click 'Edit Data'
Add an additional column (column 3 below)
![Adding an extra variable](/upfiles/13427389016701911.png)
3) Click 'Edit Source' and adjust the graph as follows:
Before:
# SHAZAM COMMAND:GRAPH
set samples 26
set title " Dynamic Forecast from VAR(1) Model for last 25 Obs of Y "
set key
set xlabel "TIME "
set ylabel
plot "Dynamic VAR_1.shd" using 1 lw 2 title "Y1 " w linespoint,\
"Dynamic VAR_1.shd" using 2 lw 2 title "PREDY1" w linespoint
quit
![Before change](/upfiles/13427389547357193.png)
After:
# SHAZAM COMMAND:GRAPH
set samples 26
set title " Dynamic Forecast from VAR(1) Model for last 25 Obs of Y "
set key
set xlabel "TIME "
set ylabel "VAR"
# ADD 2ND AXES AND PLOT CONST
set y2label "CONST"
set y2range [-15:100]
set y2tics 20 nomirror tc lt 2
plot "Dynamic VAR_1.shd" using 1 lw 2 title "Y1 " w linespoint,\
"Dynamic VAR_1.shd" using 2 lw 2 title "PRED_Y1 " w linespoint,\
"Dynamic VAR_1.shd" using 3 lw 2 title "CONST_Y2 " w linespoints axes x1y2
quit
![After the edit](/upfiles/13427389782148745.png)Thu, 19 Jul 2012 16:20:44 +0000http://community.econometrics.com/question/237/making-nice-figures/?answer=326#post-id-326