Page 1 of 1

one common legend in SPGRAPH

Posted: Sat Jan 25, 2014 8:20 am
by sleu123
Dear Tom,

I am plotting FEVD stacked graphs for 3 different countries. Each country is decomposed by five factors. I am wondering whether it is possible to have one common legend showing the colour scheme of the five factors at the bottom of the SPGRAPH? If not with SPGRAPH, what might be another way of doing so in RATS?

Code: Select all

spgraph(vfields=2,hfields=2)
graph(header='Australia',number=0,style=stacked,min=0,max=100,scale=both) 5
# AUS_FEVD_RG; # AUS_FEVD_US; # AUS_FEVD_EU; # AUS_FEVD_JP; # AUS_FEVD_CN
graph(header='Hong Kong',number=0,style=stacked,min=0,max=100,scale=both) 5
# HK_FEVD_RG; # HK_FEVD_US; # HK_FEVD_EU; # HK_FEVD_JP; # HK_FEVD_CN
graph(header='New Zealand',number=0,style=stacked,min=0,max=100,scale=both) 5
# NZ_FEVD_RG; # NZ_FEVD_US; # NZ_FEVD_EU; # NZ_FEVD_JP; # NZ_FEVD_CN
spgraph(done)
Thanks for your time in advance.

Regards,

Shawn

Re: one common legend in SPGRAPH

Posted: Mon Oct 20, 2014 10:47 am
by TomDoan
The common legend has been added with version 9. To the outer SPGRAPH, you would add the options

STYLE=STACKED,KEY=BELOW,KLABELS=||"RG","US","EU","JP","CN"|| (or whatever you want for the labels).

Re: one common legend in SPGRAPH

Posted: Thu Nov 08, 2018 2:22 pm
by Anne
Hi Tom

Is it possible to use a common legend with spgraph that can control the colors associated with series. When I try to implement this I can only seem to get the first 2 colors black and blue if I am plotting 2 series rather than the colors I have selected using the graph option i.e. the key colors don’t correspond to the actual colors plotted in the graphs

Re: one common legend in SPGRAPH

Posted: Thu Nov 08, 2018 3:17 pm
by TomDoan
Use the SYMBOLS option to remap the symbol styles.

Re: one common legend in SPGRAPH

Posted: Fri Nov 09, 2018 3:58 am
by Anne
Thanks Tom
Worked Perfectly