<?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: Put one line atop other lines in SGPANEL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Put-one-line-atop-other-lines-in-SGPANEL/m-p/802864#M22682</link>
    <description>&lt;P&gt;If I understand what you are saying, that is because your "blue line" is drawn before the others. If the blue line come from a different value of the Group variable then it likely means that the value for that line is seen by the proc before the others and drawn first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this were my project I would have separate plot statement that just created the blue line, possibly a different group variable that is only defined for the blue line, that is after the first series plot. Make the Blue not transparent for greatest contrast. Something like&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data= have  noautolegend dattrmap=attrmap;
  panelby class_new1 / spacing=5 novarname rows=3 columns=2 sort=data ;
  styleattrs datacolors=(gray) datacontrastcolors=(gray) datasymbols=(circle) datalinepatterns=(shortdash) ;
  series x=DOU_var y=DOU_score / group=SchoolID attrid=SchoolID name="line";

series x=DOU_var y=DOU_score / group=OtherSchoolID attrid=otherSchoolID ;

  scatter x=dou_var y=dou_score/ group=SchoolID attrid=SchoolID jitter  transparency=.2;
 rowaxis grid min=0 max=1;&lt;/PRE&gt;
&lt;P&gt;Which would require either adding another attrid to the Dattrmap OR you could specify the color directly with a lineattrs statement. If the OtherSchoolID variable is only on some records those are tho only wants shown.&lt;/P&gt;
&lt;P&gt;Need to add a Keylegend to only show the "Line" items to prevent two "blue" line entries in the legend with this approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another may be to sort the data so the "blue Line" group appears last in the data order but can't tell how difficult that may be without example data.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Mar 2022 20:37:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-18T20:37:50Z</dc:date>
    <item>
      <title>Put one line atop other lines in SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Put-one-line-atop-other-lines-in-SGPANEL/m-p/802856#M22681</link>
      <description>&lt;P&gt;I am trying to make a panel plot in which each panel has a set of gray lines that represent individual units and a dark blue line that is the average of those units.The problem with my chart is that I cannot seem to place the blue line atop the other gray lines. As you can see, the blue line is behind the gray ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="svh_0-1647632236010.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69574i28B4A7D406B85505/image-size/medium?v=v2&amp;amp;px=400" role="button" title="svh_0-1647632236010.png" alt="svh_0-1647632236010.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently using an attribute map to style the blue line. The gray lines get their color from within the SGPANEL procedure as such:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data attrmap;
     length ID $ 10 Value $ 8 linecolor $ 15 markercolor $ 15 linethickness 3 linepattern $ 10 markersymbol $ 20;
    infile datalines delimiter='|';
    input id  value  linecolor  markercolor linethickness linepattern markersymbol ;
	cards;
	SchoolID|Mean|CX004c6d |CX004c6d|4|Solid|SquareFilled
	;


proc sgpanel data= have  noautolegend dattrmap=attrmap;
  panelby class_new1 / spacing=5 novarname rows=3 columns=2 sort=data ;
  styleattrs datacolors=(gray) datacontrastcolors=(gray) datasymbols=(circle) datalinepatterns=(shortdash) ;
  series x=DOU_var y=DOU_score / group=SchoolID attrid=SchoolID name="line";
  scatter x=dou_var y=dou_score/ group=SchoolID attrid=SchoolID jitter  transparency=.2;
 rowaxis grid min=0 max=1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Are there ways to put the blue line atop the other gray ones so that it stands out?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 19:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Put-one-line-atop-other-lines-in-SGPANEL/m-p/802856#M22681</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2022-03-18T19:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Put one line atop other lines in SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Put-one-line-atop-other-lines-in-SGPANEL/m-p/802864#M22682</link>
      <description>&lt;P&gt;If I understand what you are saying, that is because your "blue line" is drawn before the others. If the blue line come from a different value of the Group variable then it likely means that the value for that line is seen by the proc before the others and drawn first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this were my project I would have separate plot statement that just created the blue line, possibly a different group variable that is only defined for the blue line, that is after the first series plot. Make the Blue not transparent for greatest contrast. Something like&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data= have  noautolegend dattrmap=attrmap;
  panelby class_new1 / spacing=5 novarname rows=3 columns=2 sort=data ;
  styleattrs datacolors=(gray) datacontrastcolors=(gray) datasymbols=(circle) datalinepatterns=(shortdash) ;
  series x=DOU_var y=DOU_score / group=SchoolID attrid=SchoolID name="line";

series x=DOU_var y=DOU_score / group=OtherSchoolID attrid=otherSchoolID ;

  scatter x=dou_var y=dou_score/ group=SchoolID attrid=SchoolID jitter  transparency=.2;
 rowaxis grid min=0 max=1;&lt;/PRE&gt;
&lt;P&gt;Which would require either adding another attrid to the Dattrmap OR you could specify the color directly with a lineattrs statement. If the OtherSchoolID variable is only on some records those are tho only wants shown.&lt;/P&gt;
&lt;P&gt;Need to add a Keylegend to only show the "Line" items to prevent two "blue" line entries in the legend with this approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another may be to sort the data so the "blue Line" group appears last in the data order but can't tell how difficult that may be without example data.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 20:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Put-one-line-atop-other-lines-in-SGPANEL/m-p/802864#M22682</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-18T20:37:50Z</dc:date>
    </item>
  </channel>
</rss>

