Data visualization with SAS programming

LAYOUT GRIDDED

Accepted Solution Solved
Reply
Contributor
Posts: 50
Accepted Solution

LAYOUT GRIDDED

Hi all

I am using layout gridded to merge the legends to get the following inside the graph

Capture.PNG

Iam using the following code

Layout Gridded / halign=left valign=bottom border=yes;

       entry halign=left "drug";

   mergedlegend '1' 'a' /border=no;
   mergedlegend '2' 'b' /border=no;
   mergedlegend '3' 'c' /border=no;

        endlayout;

How can I align properly, you see blue line is center as it is shorter and red line is longer! I need to align this properly as it looks awkward now!!

J


Accepted Solutions
Solution
‎06-18-2015 07:57 PM
SAS Super FREQ
Posts: 1,145

Re: LAYOUT GRIDDED

First, you should get the right merging if the data is grouped.

Second, if you must do your own grid, try Layout GlobalLegend.  It tries to combine multiple legends in a good way.

Please see the GTL doc for the details.

View solution in original post


All Replies
Super User
Posts: 11,134

Re: LAYOUT GRIDDED

What are the Formats associated with the variables that are producing XX, YYYYY and ZZZ? I would try making sure that the lengths of those variables's formats are all the same (longest).

The picture displayed doesn't really look like the blue is shorter just that the whole contents of line and label are centered and the text is shorter so the left and right displayed area are more towards the center.

Have you tried haling = left on each of merged items?

Contributor
Posts: 50

Re: LAYOUT GRIDDED

Blue is not shorter but the legendlabel associated with it is shorter thats why its center aligned

halign where shoudl i use it?

Contributor
Posts: 50

Re: LAYOUT GRIDDED

There are no format associated I just give it in the legendlabel statement Please see below

scatterplot x=chg1 y=pct1 / markerattrs=graphdata1(size=8.5 symbol=trianglefilled)  name='a' legendlabel="XX";

    stepplot    x=chg1 y=pct1 / lineattrs=graphdata1(pattern=solid  thickness=1) name='1' legendlabel="XX"*/;

    scatterplot x=chg2 y=pct2 / markerattrs=graphdata2(size=8.5 symbol=circlefilled) name='b' legendlabel="YYYYY";

    stepplot    x=chg2 y=pct2 / lineattrs=graphdata2(pattern=shortdash  thickness=1)   name='2' legendlabel="YYYYY";

  scatterplot x=chg3 y=pct3 / markerattrs=graphdata3(size=8.5 symbol=SquareFilled) name='c' legendlabel="ZZZ";

    stepplot    x=chg3 y=pct3 / lineattrs=graphdata3(pattern=mediumdash  thickness=1)   name='3' legendlabel="ZZZ";

Solution
‎06-18-2015 07:57 PM
SAS Super FREQ
Posts: 1,145

Re: LAYOUT GRIDDED

First, you should get the right merging if the data is grouped.

Second, if you must do your own grid, try Layout GlobalLegend.  It tries to combine multiple legends in a good way.

Please see the GTL doc for the details.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 468 views
  • 3 likes
  • 3 in conversation