Data visualization with SAS programming

Layout Overlay nested in Layout Lattice

Reply
Contributor
Posts: 50

Layout Overlay nested in Layout Lattice

I have a graph in which layout overlay is nested in Layout Lattice! I need split the label of y axis , how can achieve this

When I use labelfitpolicy=Split its being replaced with AUTO

From documentation I see the following

DefaultAUTO
InteractionsThis option has effect only when LABELPOSITION= is CENTER or DATACENTER.
When the overlay layout is nested in a lattice layout, SPLIT is ignored and AUTO is used instead.

How Can I achieve this now?

Please let me know your thoughts!!

Thanks

J

SAS Super FREQ
Posts: 1,044

Re: Layout Overlay nested in Layout Lattice

Well, the doc clearly says you cannot use split Y axis when Overlay is nested in a Lattice.  If you attach your program and data and a figure of what you want, maybe we can find an alternative.  Which release of SAS are you using?

Contributor
Posts: 50

Re: Layout Overlay nested in Layout Lattice

Hi

I am using SAS 9.4 version , Please see yaxis label!!

proc template;

   define statgraph plot1;

      begingraph / designwidth=9.0in designheight=5.05in border=yes;

      entrytitle "&param" / textattrs=(size=9);

   layout lattice / columndatarange=union rowweights=(0.95); ;

   layout overlay /

      xaxisopts=(name="xaxis" discreteopts=(tickvaluefitpolicy=extract) offsetmax=0.05 tickvalueattrs=(size=9pt) type=linear display=(line ticks tickvalues)

      linearopts=(tickvaluefitpolicy=none tickvaluelist=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33)

                  ))

      yaxisopts=(label="This is a ver very very very very long long long text" tickvalueattrs=(size=9pt)

   linearopts=(tickvaluesequence=(start=&&ymin&i end=&&ymax&i increment=&&ytick&i) viewmin=&&ymin&i viewmax=&&ymax&i  minorticks=true)

                );

      seriesplot  x=eval(atptn-1*&offx) y=mean1/   lineattrs=graphdata1(pattern=solid thickness=1) name='1' legendlabel="Drug C";

      scatterplot x=eval(atptn-1*&offx) y=mean1/   YErrorUpper=High1 YErrorLower=Low1

                  markerattrs=graphdata1(symbol=trianglefilled size=10) errorbarattrs=graphdata1(pattern=solid)

                  name='a' legendlabel="Drug C";

      seriesplot  x=eval(atptn)         y=mean2 /   lineattrs=graphdata2(pattern=shortdash  thickness=1) name='2' legendlabel="Drug A";

      scatterplot x=eval(atptn)         y=mean2 /   YErrorUpper=High2 YErrorLower=Low2

                  markerattrs=graphdata2(symbol=circlefilled size=8.5) errorbarattrs=graphdata2(pattern=solid)

                  name='b' legendlabel="Drug A";

   seriesplot  x=eval(atptn+1*&offx) y=mean3 /   lineattrs=graphdata3(pattern=mediumdash  thickness=1) name='3' legendlabel="Drug B";

      scatterplot x=eval(atptn+1*&offx) y=mean3 /   YErrorUpper=High3 YErrorLower=Low3

                  markerattrs=graphdata3(symbol=asterisk size=8.5) errorbarattrs=graphdata3(pattern=solid)

                  name='c' legendlabel="Drug B";

      endlayout;

      sidebar / spacefill=false;

  discretelegend 'a' 'b' 'c' / title='Treatment Group: ' across=3;

      endsidebar;

      endlayout;

    endgraph;

   end;

run;

Contributor
Posts: 50

Re: Layout Overlay nested in Layout Lattice

PARAMCDPARAMtrta1SEQVISITn1mean1stderr1high1low1trta2n2mean2stderr2high2low2
TESTCDTestDRUG A1Day 115118.44443.90552122.35114.5389DRUG B15109.52.958968112.459106.541
TESTCDTestDRUG A2Day 215114.22224.112237118.3345110.11DRUG B15107.752.296654110.0467105.4533
TESTCDTestDRUG A3Day 3151174.368447121.3684112.6316DRUG B15111.52.692582114.1926108.8074
TESTCDTestDRUG A4Day 415120.11115.078398125.1895115.0327DRUG B15115.16673.161878118.3285112.0048
TESTCDTestDRUG A5Day 515115.33332.44949117.7828112.8838DRUG B15111.41673.583333115107.8333
TESTCDTestDRUG A6Day 615115.77784.875613120.6534110.9022DRUG B15110.252.46836112.7184107.7816
TESTCDTestDRUG A7Day 715112.11114.21454116.3257107.8966DRUG B15107.33332.422537109.7559104.9108
TESTCDTestDRUG A8Day 8151154.546061119.5461110.4539DRUG B15108.52.053542110.5535106.4465
TESTCDTestDRUG A9Day 915112.55564.343293116.8988108.2123DRUG B15107.71433.263903110.9782104.4504
TESTCDTestDRUG A10Day 10151204.734624124.7346115.2654DRUG B15117.92864.253588122.1822113.675
TESTCDTestDRUG A11Day 11151154.898979119.899110.101DRUG B15112.53.562241116.0622108.9378
TESTCDTestDRUG A12Day 1215115.55564.687783120.2433110.8678DRUG B15113.53.735411117.2354109.7646
TESTCDTestDRUG A13Day 1315109.22223.035795112.258106.1864DRUG B15109.21432.568145111.7824106.6461
TESTCDTestDRUG A14Day 1415110.66674.705198115.3719105.9615DRUG B15110.64292.873921113.5168107.7689
TESTCDTestDRUG A15Day 15151144.487637118.4876109.5124DRUG B15110.85713.60838114.4655107.2488
SAS Super FREQ
Posts: 1,044

Re: Layout Overlay nested in Layout Lattice

Your GTL code has macro variables and some variables not included.  I changed some of those values and got a graph showing the entire Y axis label.  Reducing the height of the graph did produce the log message.  You can set LabelSplitPolicy to SPLITALWAYS and set LABELSPLITCHAR="," to split it where you want.



               yaxisopts=(label="This is a ver very very very very, long long long text" tickvalueattrs=(size=9pt)

                                   labelfitpolicy=splitalways labelsplitchar=','


Also, I think this graph can be made using SGPLOT as shown below without the macro variables where due to the absence of the LATTICE, the Y axis gets split as expected.  For some reason, I cannot attach the image.


proc sgplot data=values;

  series x=seq y=mean1/  lineattrs=graphdata1(pattern=solid thickness=1) name='1' legendlabel="Drug C";

  scatter x=seq y=mean1/  YErrorUpper=High1 YErrorLower=Low1

                  markerattrs=graphdata1(symbol=trianglefilled size=10) errorbarattrs=graphdata1(pattern=solid)

                  name='a' legendlabel="Drug C";

    series x=seq        y=mean2 /  lineattrs=graphdata2(pattern=shortdash  thickness=1) name='2' legendlabel="Drug A";

    scatter x=seq        y=mean2 /  YErrorUpper=High2 YErrorLower=Low2

                  markerattrs=graphdata2(symbol=circlefilled size=8.5) errorbarattrs=graphdata2(pattern=solid)

                  name='b' legendlabel="Drug A";

  xaxis integer values=(1 to 15 by 1);

  yaxis label="This is a very very very very very long long long text";

  keylegend 'a' 'b';

run;



Post a Question
Discussion Stats
  • 4 replies
  • 417 views
  • 0 likes
  • 2 in conversation