Page 1 of 1

plotting IRFs - line pattern

Posted: Wed Mar 09, 2016 9:51 am
by werner
Hi Tom,

I m trying to make thicker IRF lines in the graphs.

For this I saved the attached .txt file in the directory. (also tryied to save it from within Rats, with no change)

In the program I then inserted two lines before the plots

open styles thicklines.txt
grparm(import=styles)

The plot instruction later is
graph(nodates,number=0,header=pr(i+j-1)) 3
# irf(j,1) / 2
# lower(j,1) / 1
# upper(j,1) / 1

The program seems to ignore the thicklines.txt, as plots continue to follow the standard pattern lines.
Do I need to change something else so that the lines follow the standards set in thicklines.txt?

Thanks.

Re: plotting IRFs - line pattern

Posted: Wed Mar 09, 2016 10:53 am
by TomDoan
First, you have COLOR misspelled, so your last three lines have no effect. However, I'm not 100% sure what you're trying to do. There are two completely separate sets of line representations: BW are for when you want entirely black and white (as for a standard journal article), COLOR is for ordinary use. You can choose the BW representation explicitly with the PATTERNS option on the GRAPH instruction, or you can switch to it using the rightmost toolbar icon on the graph window.

LINE_BW_1=2,0.2,3.0
LINE_BW_2=0,0.0,3.0
LINE_BW_3=2,0.2,3.0
LINE_COLOR_4=2,1,3.0
LINE_COLOR_5=0,1,3.0
LINE_COLOR_6=2,1,3.0

What this does is to redefine BW styles 1, 2 and 3 and COLOR styles 4, 5 and 6. Because your graph only uses styles 1 and 2, the changes to LINE_COLOR won't have any effect even when the typo is fixed. If you toggle onto the B and W representation, you'll see that the thickness changes that you made to BW styles 1 and 2 are working. If you're trying to also make the color styles thicker, you need to define LINE_COLOR_1 and LINE_COLOR_2. Note, however, that the second argument in the color lines should be an RGB code. "1" is effectively black with just a tiny amount of blue. If you change the final three lines to (say)

LINE_COLOR_1=2,000000,3.0
LINE_COLOR_2=0,0000FF,3.0
LINE_COLOR_3=2,FF0000,3.0

that will define color style 1 as thick black dashes, color style 2 as thick solid blue and color style 3 as thick red dashes.

Re: plotting IRFs - line pattern

Posted: Wed Mar 09, 2016 12:03 pm
by werner
Thanks for the helpful clarification. I thought that I had to use BW, but it worked with COLOR, as you suggested.

Re: plotting IRFs - line pattern

Posted: Thu Mar 24, 2016 9:50 pm
by cczzwhy
Hello Tom!I got some questions about compute spgraph,first I got errors like

Code: Select all

Subscripting Error. Had Array Reference with (). Needed (INTEGER,INTEGER)
## SX27. Illegal Combination of Data Types for Operation
>>>>ader=shocklabels(5)<<<<
when i compute my code

Code: Select all

compute shocklabels=||"Y","PI","U","A","CA"||
compute varlabels=||"Output","Inflation","Unemployment","Assets","Caflow"||

@MCProcessIRF(model=varmodel,percentiles=||.025,.975||,center=median,lower=lower95,upper=upper95,irf=irf1)

spgraph(vfields=3,hfields=2)
    * spgraph(vfields=2,hfields=2,header=shockheader)
     graph(row=1,col=1,header=shocklabels(5),nodates,ovcount=5,overlay=fan,ovsame) 1
     # irf1(5,5)
     graph(row=1,col=2,header=shocklabels(4),nodates,ovcount=5,overlay=fan,ovsame) 1
     # irf1(4,5)
     graph(row=2,col=1,header=shocklabels(3),nodates,ovcount=5,overlay=fan,ovsame) 1
     # irf1(3,5)
     graph(row=2,col=2,header=shocklabels(2),nodates,ovcount=5,overlay=fan,ovsame) 1
     # irf1(2,5)
     graph(row=3,col=1,header=shocklabels(1),nodates,ovcount=5,overlay=fan,ovsame) 1
     # irf1(1,5)
     spgraph(done)
spgraph(done)
.
Second,what should I do to plot several lines in different rpfs in one graph?I want to compare the paths.

Thanks in advance!

Re: plotting IRFs - line pattern

Posted: Fri Mar 25, 2016 6:57 am
by TomDoan
Add

dec vect[strings] shocklabels varlabels

before you do the two COMPUTE's. As written, those will be treated as RECT[LABELS].

I'm not sure I understand your second question.

Re: plotting IRFs - line pattern

Posted: Sat Mar 26, 2016 5:47 am
by cczzwhy
Thank you very much!It woks fine.
And I'm sorry for that I did not make it clearly.Actually I am running this program now for the US data,and I run it again for Japan data,the question is how can i get the impulse responses of the same variable such as the assets in one single graph?

Thanks in advance!

Re: plotting IRFs - line pattern

Posted: Thu Apr 07, 2016 5:46 am
by cczzwhy
Hello Tom! I used this code to create a style file, the lines and colors are OK.But it did not produce any symbol I want ,is there sth wrong?

Code: Select all

symbol_color_1=0,000000,1.0
symbol_color_2=7,0000FF,1.0
symbol_color_3=9,FF0000,1.0

Re: plotting IRFs - line pattern

Posted: Thu Apr 07, 2016 8:21 am
by TomDoan
Did you choose a graph style that uses symbols (STYLE=SYMBOLS)? If you don't, it doesn't matter.

Re: plotting IRFs - line pattern

Posted: Fri Apr 08, 2016 7:43 am
by cczzwhy
Thank you very much!It works fine.
And I got another question about printing a landscape graph.This is the code

Code: Select all

open styles comcom.txt
grparm(import=styles)
env gsave="c:\Estima\test.rgf" gformat=LANDSCAPE
spgraph(vfields=3,hfields=4,STYLE=SYMBOLS)
spgraph(rgf="c:\Estima\comp1.rgf")
spgraph(rgf="c:\Estima\comp2.rgf")
spgraph(rgf="c:\Estima\comp3.rgf")
spgraph(rgf="c:\Estima\comp4.rgf")
spgraph(rgf="c:\Estima\comp5.rgf")
spgraph(rgf="c:\Estima\comp6.rgf")
spgraph(rgf="c:\Estima\comp7.rgf")
spgraph(rgf="c:\Estima\comp8.rgf")
spgraph(rgf="c:\Estima\comp9.rgf")
spgraph(rgf="c:\Estima\comp10.rgf")
spgraph(rgf="c:\Estima\comp11.rgf")
spgraph(rgf="c:\Estima\comp12.rgf")
spgraph(done)
I produced the graph.I printed this graph in landscape manually but it cannot be printed completely as showed in the graph attached.Is there any other way?

Re: plotting IRFs - line pattern

Posted: Fri Apr 08, 2016 2:59 pm
by TomDoan
How did you produce graph01.pdf?

Re: plotting IRFs - line pattern

Posted: Fri Apr 08, 2016 9:16 pm
by cczzwhy
I used the print window as in the graphs I attached( i am sorry that I am using the Japanese version right now,so i will try to make it clealy).

Step1,I clicked the print button to produce a print window.
in step2 i checked the button which means[ export to file] in the print window.
In step3 i changed the layout to landscape form ,then it can be exported as a graph pdf to file folds .

These are the steps i got the as showed in graph01.pdf .I am not sure if I told it clearly...