storing graphs as wmf

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
paretto
Posts: 13
Joined: Tue Mar 30, 2010 11:02 am

storing graphs as wmf

Unread post by paretto »

Dear Tom,

I try to use rats to produce graphics, which I used to produce in excel. I have two questions:
1. I saw in the user guide that I have to store and to load a text file in order to adjust the thickness and symbols of line graphs.
Is there a possibility to adjust the line thickness directly in the graph instruction without defining style sheets externaly.

2. When I store graphs automatically via
enviroment gsave="filename*.wmf" gformat=portrait

The graph is stored, but if I try to open the wmf file in word or any other microsoft application there is an error message or an empty picture. It works fine if I store the graphs by hand, but it fails when I store the graphs automatically.
Do you have any idea what the error could be?

Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: storing graphs as wmf

Unread post by TomDoan »

paretto wrote:Dear Tom,

I try to use rats to produce graphics, which I used to produce in excel. I have two questions:
1. I saw in the user guide that I have to store and to load a text file in order to adjust the thickness and symbols of line graphs.
Is there a possibility to adjust the line thickness directly in the graph instruction without defining style sheets externaly.
No.
paretto wrote: 2. When I store graphs automatically via
enviroment gsave="filename*.wmf" gformat=portrait

The graph is stored, but if I try to open the wmf file in word or any other microsoft application there is an error message or an empty picture. It works fine if I store the graphs by hand, but it fails when I store the graphs automatically.
Do you have any idea what the error could be?

Thanks in advance
GFORMAT=PORTRAIT is for PostScript (portrait orientation). Use GFORMAT=WMF for WMF
paretto
Posts: 13
Joined: Tue Mar 30, 2010 11:02 am

Re: storing graphs as wmf

Unread post by paretto »

Dear Tom, I tried to adjust the layout of line graphs using stylesheets, but unfortunately the graph is unaffected despite importing styles.

I use the graphfoecast.prg example

* before style definition
graph(header="Forecasts of Japanese IP",grid=t==2006:12) 2
# jpniptotrs 2004:1 2006:12
# jpnfore 2006:12 2008:12
*style definition in the file colour.txt : SYMBOL_COLOR_2=1,FF0000,1
open styles colour.txt
grparm(import=styles)
*after style definition
graph(header="Forecasts of Japanese IP",grid=t==2006:12) 2
# jpniptotrs 2004:1 2006:12
# jpnfore 2006:12 2008:12

The two graphs look exactly the same. despite importing the style sheets. Where is my mistake?

Thanks in advance again

Paul
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: storing graphs as wmf

Unread post by TomDoan »

SYMBOL_COLOR_2=1,FF0000,1

changes symbol 2, not line 2. You want the following:

LINE_COLOR_2=1,FF0000,1

to change 2 to thin solid red.
paretto
Posts: 13
Joined: Tue Mar 30, 2010 11:02 am

Re: storing graphs as wmf

Unread post by paretto »

Dear Tom thank you for the quick reply. I was completely wrong thank you for correcting me.
But I still have two questions:
Question 1:
I changed the colour definitions in the file colour.txt to

LINE_COLOR_1=0,00FF00,1
LINE_COLOR_2=0,FF0000,1

The first line should be green and the second red. But what is very strange the first line is green as deined but the second is blue instead of red. When I change the colour for the second line to
black LINE_COLOR_2=0,000000,1 the second line is displayed red. Is there a problem with rats (I'm still using 7.1) to interprete FF0000 as red?

esmooth(trend=select,seasonal=select,forecast=jpnfore,steps=24) jpniptotrs
set jpnfore 2006:12 2006:12 = jpniptotrs
graph(header="Forecasts of Japanese IP",grid=t==2006:12) 2
# jpniptotrs 2004:1 2006:12
# jpnfore 2006:12 2008:12

open styles colour.txt
*LINE_COLOR_1=0,00FF00,1
*LINE_COLOR_2=0,FF0000,1
grparm(import=styles)

esmooth(trend=select,seasonal=select,forecast=jpnfore,steps=24) jpniptotrs
set jpnfore 2006:12 2006:12 = jpniptotrs
graph(header="Forecasts of Japanese IP",grid=t==2006:12) 2
# jpniptotrs 2004:1 2006:12
# jpnfore 2006:12 2008:12



Question 2:
I know that I can change the colour using the representation option. But in this case it is unpossible to display the series in different samples like in the example above.
Is there a way to define the colour of each line using the representation option and definig the display sample for each series separateley. For example:

esmooth(trend=select,seasonal=select,forecast=jpnfore,steps=24) jpniptotrs
set jpnfore 2006:12 2006:12 = jpniptotrs
graph(header="Forecasts of Japanese IP",grid=t==2006:12) 2
# jpniptotrs 2004:1 2006:12 /3
# jpnfore 2006:12 2008:12 /4

Unfortunately this does not work.

Thank you

Paul
Post Reply