Hi, This is a problem I already had 18 months ago. http://communities.sas.com/message/29788#29788 At that time, Dan proposed me a solution but in my today’s case, that solution is not possible. My conclusion at that time was: in fact, you can't use your own style elements (with their own names) to customize your result. I received no deny but maybe there is a solution… My today’s problem: When using proc template, you can create any style element you'd like and give any name to that style element. The problem is that, if the style element is not having a referenced name, you can't use the style elements you created this way. A little example will help... proc template; define statgraph contourplotparm; begingraph; LAYOUT LATTICE / COLUMNS=2 ROWS=2 ; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=12 name="Contour" colormodel=threecolorramp; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=16 name="Contour" colormodel=threecolorramp; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=20 name="Contour" colormodel=threecolorramp; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=24 name="Contour" colormodel=threecolorramp; endlayout; endlayout; endgraph; end; run; proc sgrender data=sashelp.gridded template=contourplotparm; run; That template is creating a 2*2 ceils graph. the same contourplotparm graph is reproduced in the four cells. As an option, I indicate COLORMODEL=threecolorramp (but this is the default). The colors used for this graph (red / blue / white by default) are defined by a style element named threecolorramp. To modify the colors, you should use the colormodel option. The value of that option can only be a style element (colormodel=(options) is not possible as colormodel=style-element(options)) I'd like to use for each cell its own triplet of colors. So, I run this second proc template. proc template ; define style toto ; parent=styles.statistical ; class threecolorramp1 / endcolor=CXD3D3D3 startcolor=CXFFDAB9 neutralcolor=CXF0E68C; class threecolorramp2 / endcolor=CXFFB6C1 startcolor=CXFFFFF0 neutralcolor=CX808000; class threecolorramp3 / endcolor=CXFFF8DC startcolor=CXD8BFD8 neutralcolor=CX708090; class threecolorramp4 / endcolor=CXFFDEAD startcolor=CX6A5ACD neutralcolor=CX778899; end; quit; (colors are selected randomly) Creating those brand new style elements with their own names is not a problem: the log is clear and the style elements are created. But you can't use them! Replace in the first proc template the name of the style element threecolorramp by the names of the style elements you created (no problem here, the log is clear when running the proc template) but if you run the PROC SGRENDER, you’ll see that it's not functioning. proc template; define statgraph contourplotparm; begingraph; LAYOUT LATTICE / COLUMNS=2 ROWS=2 ; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=12 name="Contour" colormodel=threecolorramp1; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=16 name="Contour" colormodel=threecolorramp2; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=20 name="Contour" colormodel=threecolorramp3; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=24 name="Contour" colormodel=threecolorramp4; endlayout; endlayout; endgraph; end; run; ods listing style=toto ; proc sgrender data=sashelp.gridded template=contourplotparm; run; I’m having, in my (French) log the following message: WARNING: La référence du style threecolorramp1' est incorrecte. Ignorée. WARNING: La référence du style threecolorramp2' est incorrecte. Ignorée. WARNING: La référence du style threecolorramp3' est incorrecte. Ignorée. WARNING: La référence du style threecolorramp4' est incorrecte. Ignorée. The option COLORMODEL is only accepting a very short list of style elements as value (threecolorramp, threecoloraltramp, twocolorramp and twocoloraltramp). proc template ; define style toto ; parent=styles.statistical ; class threecolorramp / endcolor=CXD3D3D3 startcolor=CXFFDAB9 neutralcolor=CXF0E68C; class threecoloraltramp / endcolor=CXFFB6C1 startcolor=CXFFFFF0 neutralcolor=CX808000; class twocolorramp3 / endcolor=CXFFF8DC startcolor=CXD8BFD8 ; class twocoloraltramp / endcolor=CXFFDEAD startcolor=CX6A5ACD ; end; quit; proc template; define statgraph contourplotparm; begingraph; LAYOUT LATTICE / COLUMNS=2 ROWS=2 ; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=12 name="Contour" colormodel=threecolorramp; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=16 name="Contour" colormodel=threecoloraltramp; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=20 name="Contour" colormodel=twocolorramp; endlayout; layout overlay; contourplotparm x=height y=weight z=density / contourtype=fill nhint=24 name="Contour" colormodel=twocoloraltramp; endlayout; endlayout; endgraph; end; run; ods listing style=toto ; proc sgrender data=sashelp.gridded template=contourplotparm; run; Is there a way to add to the authorized list of style elements (since there is one) the style elements I create? (my real problem is more complicated than the example I’m proposing here… the number of cells of my graph is not limited to 4 and can be much higher) I’ll send a wonderful present to the person who will find me the solution 😉 Best regards Sébastien Ringuedé
... View more