<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Some Questions about Layout Datalattice in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530777#M17720</link>
    <description>&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp; How to specify different&amp;nbsp;colors and symbols for values of DriveTrain, "All", "Front", and "Rear"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Dan] - If you care about which color and symbols are associated with each value, use a DiscreteAttrMap; otherwise, you can change the colors and symbols using the DATACONTRASTCOLORS and DATASYMBOLS options on the BEGINGRAPH statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. There are two panels named "SUV" and "Sedan" in the plot.&amp;nbsp; How to show their&amp;nbsp;variable name "Type" on the top like "Cylinders"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Dan] - Use a DATAPANEL with COLUMNS=1 (the default) instead of a DATALATTICE.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. How to make the sidebar located at the right top corner of this plot?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Dan] - There is not a nice way to do this. I would recommend keeping the legend at the bottom to optimize your space.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below are the recommended changes to your code. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table CARS as
select *
from sashelp.cars
where Type = "SUV" or Type = "Sedan";
quit;

proc template;
define statgraph scatter;
begingraph / backgroundcolor=CXD1D0CE border=true borderattrs=(color=CXEDDA74 thickness=5);
entrytitle halign=left textattrs=(size=15pt) "Plot";
discreteattrmap name="scatmap";
   value "All" / markerattrs=(color=orange symbol=circlefilled);
   value "Front" / markerattrs=(color=purple symbol=circlefilled);
   value "Rear" / markerattrs=(color=green symbol=circlefilled);
enddiscreteattrmap;
discreteattrvar attrvar=mapvar var=Drivetrain attrmap="scatmap";
layout datapanel   classvars=(Type) /
        headerlabeldisplay=value
        rowaxisopts=(display=standard griddisplay=on gridattrs=(pattern=dash) labelposition=top labelattrs=(size=11pt))
        columnaxisopts=(griddisplay=on gridattrs=(pattern=dash) labelattrs=(size=12pt weight=normal))
        headerbackgroundcolor=CXD1D0CE headerborder=false headerlabelattrs=(size=11pt weight=normal color=CX000000);
layout prototype;
scatterplot x=MPG_City y=Cylinders / group=mapvar name='a';
endlayout;
sidebar / align=bottom spacefill=false;
	discretelegend "a" / border=false valueattrs=(size=11pt) title="DriveTrain";
endsidebar;
endlayout;
endgraph;
end;
run;

proc sgrender data=CARS template=scatter;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Jan 2019 20:44:56 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2019-01-28T20:44:56Z</dc:date>
    <item>
      <title>Some Questions about Layout Datalattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530741#M17717</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have three questions about layout data lattice.&amp;nbsp; I used sample dataset sashelp.cars to create the plot and attached it below.&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; How to specify different&amp;nbsp;colors and symbols for values of DriveTrain, "All", "Front", and "Rear"?&lt;/P&gt;&lt;P&gt;2. There are two panels named "SUV" and "Sedan" in the plot.&amp;nbsp; How to show their&amp;nbsp;variable name "Type" on the top like "Cylinders"?&lt;/P&gt;&lt;P&gt;3. How to make the sidebar located at the right top corner of this plot?&lt;/P&gt;&lt;P&gt;I hope everything makes sense to you.&amp;nbsp; Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table CARS as
select * 
from sashelp.cars
where Type = "SUV" or Type = "Sedan";
quit;

proc template;
define statgraph scatter;
begingraph / backgroundcolor=CXD1D0CE border=true borderattrs=(color=CXEDDA74 thickness=5);
entrytitle halign=left textattrs=(size=15pt) "Plot";
layout datalattice rowvar=Type / 
				   headerlabeldisplay=value rowheaders=left
                   rowaxisopts=(display=standard griddisplay=on gridattrs=(pattern=dash) labelposition=top labelattrs=(size=11pt)) 
				   columnaxisopts=(griddisplay=on gridattrs=(pattern=dash) labelattrs=(size=12pt weight=normal))
				   headerbackgroundcolor=CXD1D0CE headerborder=false headerlabelattrs=(size=11pt weight=normal color=CX000000);
layout prototype;
scatterplot x=MPG_City y=Cylinders / group=DriveTrain markerattrs=(color=CXC11B17 symbol=circlefilled) name='a';
endlayout;
sidebar / align=bottom spacefill=false;
	discretelegend "a" / border=false valueattrs=(size=11pt) title="DriveTrain";
endsidebar;
endlayout;
endgraph;
end;
run;

proc sgrender data=CARS template=scatter;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture_Car.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26639i002FD478815312D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture_Car.PNG" alt="Capture_Car.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 19:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530741#M17717</guid>
      <dc:creator>Relax</dc:creator>
      <dc:date>2019-01-28T19:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Some Questions about Layout Datalattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530777#M17720</link>
      <description>&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp; How to specify different&amp;nbsp;colors and symbols for values of DriveTrain, "All", "Front", and "Rear"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Dan] - If you care about which color and symbols are associated with each value, use a DiscreteAttrMap; otherwise, you can change the colors and symbols using the DATACONTRASTCOLORS and DATASYMBOLS options on the BEGINGRAPH statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. There are two panels named "SUV" and "Sedan" in the plot.&amp;nbsp; How to show their&amp;nbsp;variable name "Type" on the top like "Cylinders"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Dan] - Use a DATAPANEL with COLUMNS=1 (the default) instead of a DATALATTICE.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. How to make the sidebar located at the right top corner of this plot?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Dan] - There is not a nice way to do this. I would recommend keeping the legend at the bottom to optimize your space.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below are the recommended changes to your code. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table CARS as
select *
from sashelp.cars
where Type = "SUV" or Type = "Sedan";
quit;

proc template;
define statgraph scatter;
begingraph / backgroundcolor=CXD1D0CE border=true borderattrs=(color=CXEDDA74 thickness=5);
entrytitle halign=left textattrs=(size=15pt) "Plot";
discreteattrmap name="scatmap";
   value "All" / markerattrs=(color=orange symbol=circlefilled);
   value "Front" / markerattrs=(color=purple symbol=circlefilled);
   value "Rear" / markerattrs=(color=green symbol=circlefilled);
enddiscreteattrmap;
discreteattrvar attrvar=mapvar var=Drivetrain attrmap="scatmap";
layout datapanel   classvars=(Type) /
        headerlabeldisplay=value
        rowaxisopts=(display=standard griddisplay=on gridattrs=(pattern=dash) labelposition=top labelattrs=(size=11pt))
        columnaxisopts=(griddisplay=on gridattrs=(pattern=dash) labelattrs=(size=12pt weight=normal))
        headerbackgroundcolor=CXD1D0CE headerborder=false headerlabelattrs=(size=11pt weight=normal color=CX000000);
layout prototype;
scatterplot x=MPG_City y=Cylinders / group=mapvar name='a';
endlayout;
sidebar / align=bottom spacefill=false;
	discretelegend "a" / border=false valueattrs=(size=11pt) title="DriveTrain";
endsidebar;
endlayout;
endgraph;
end;
run;

proc sgrender data=CARS template=scatter;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jan 2019 20:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530777#M17720</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-01-28T20:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Some Questions about Layout Datalattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530802#M17724</link>
      <description>&lt;P&gt;Thanks for your help, Dan&lt;/P&gt;&lt;P&gt;All of them work well now&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 21:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Some-Questions-about-Layout-Datalattice/m-p/530802#M17724</guid>
      <dc:creator>Relax</dc:creator>
      <dc:date>2019-01-28T21:24:12Z</dc:date>
    </item>
  </channel>
</rss>

