<?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 proc sgpanel: moving refline and data labels in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sgpanel-moving-refline-and-data-labels/m-p/843303#M333403</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a figure equivalent to this one:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc summary data=sashelp.cars noprint nway;
	var MSRP;
	class Origin DriveTrain;
	output out=cars_summary lclm= uclm= mean= /autoname;
run;

data cars_for_plot;
	set sashelp.cars cars_summary;
run;

proc sgpanel data=cars_for_plot;
	panelby DriveTrain / layout=columnlattice noborder noheader columns=3 skipemptycells sort=ascformat;
	rowaxis type=log label="MSRP";
	colaxis label=" " fitpolicy=rotatealways valuesrotate=vertical discreteorder=formatted;
	keylegend "ssss" / position=right noborder;
	vbarparm category=Origin response=MSRP_Mean / group=DriveTrain groupdisplay=cluster grouporder=ascending baseline=10 datalabel datalabelfitpolicy=none name="ssss";
	highlow x=Origin high=MSRP_UCLM low=MSRP_LCLM / group=DriveTrain highcap=serif lowcap=serif;
	scatter x=Origin y=MSRP / group=DriveTrain jitter markerattrs=(symbol=circlefilled size=5) transparency=0.50 clusterwidth=0.7;
	refline 1e5 / lineattrs=(pattern=shortdash) label="LLOD";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have received a request to improve two visual aspects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;move the refline label outside of the plot so that it is only printed once per row: is this possible with sgpanel?&lt;/LI&gt;&lt;LI&gt;move the vbar labels up so that these do not overlap with error bars and the scatter plot: is this possible?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you for your input in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2022 09:28:10 GMT</pubDate>
    <dc:creator>js5</dc:creator>
    <dc:date>2022-11-09T09:28:10Z</dc:date>
    <item>
      <title>proc sgpanel: moving refline and data labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgpanel-moving-refline-and-data-labels/m-p/843303#M333403</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a figure equivalent to this one:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc summary data=sashelp.cars noprint nway;
	var MSRP;
	class Origin DriveTrain;
	output out=cars_summary lclm= uclm= mean= /autoname;
run;

data cars_for_plot;
	set sashelp.cars cars_summary;
run;

proc sgpanel data=cars_for_plot;
	panelby DriveTrain / layout=columnlattice noborder noheader columns=3 skipemptycells sort=ascformat;
	rowaxis type=log label="MSRP";
	colaxis label=" " fitpolicy=rotatealways valuesrotate=vertical discreteorder=formatted;
	keylegend "ssss" / position=right noborder;
	vbarparm category=Origin response=MSRP_Mean / group=DriveTrain groupdisplay=cluster grouporder=ascending baseline=10 datalabel datalabelfitpolicy=none name="ssss";
	highlow x=Origin high=MSRP_UCLM low=MSRP_LCLM / group=DriveTrain highcap=serif lowcap=serif;
	scatter x=Origin y=MSRP / group=DriveTrain jitter markerattrs=(symbol=circlefilled size=5) transparency=0.50 clusterwidth=0.7;
	refline 1e5 / lineattrs=(pattern=shortdash) label="LLOD";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have received a request to improve two visual aspects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;move the refline label outside of the plot so that it is only printed once per row: is this possible with sgpanel?&lt;/LI&gt;&lt;LI&gt;move the vbar labels up so that these do not overlap with error bars and the scatter plot: is this possible?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you for your input in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 09:28:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgpanel-moving-refline-and-data-labels/m-p/843303#M333403</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2022-11-09T09:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgpanel: moving refline and data labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgpanel-moving-refline-and-data-labels/m-p/843328#M333414</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.cars noprint nway;
 var MSRP;
 class Origin DriveTrain;
 output out=cars_summary lclm= uclm= mean= /autoname;
run;

data cars_for_plot;
 set sashelp.cars cars_summary nobs=nobs;
 if _n_ =nobs-2 or _n_= nobs-1 or _n_= nobs then ref=1e5;
    if _n_=nobs then label="LLOD" ;

 if not missing(MSRP_Mean) then y_datalabel=MSRP_Mean+120000;
run;

proc sgpanel data=cars_for_plot;
 panelby DriveTrain / layout=columnlattice noborder noheader columns=3 skipemptycells sort=ascformat;
 rowaxis type=log label="MSRP";
 colaxis label=" " fitpolicy=rotatealways valuesrotate=vertical discreteorder=formatted;
 keylegend "ssss" / position=right noborder;
 vbarparm category=Origin response=MSRP_Mean / group=DriveTrain groupdisplay=cluster grouporder=ascending baseline=10  name="ssss";
    scatter x=Origin y=y_datalabel/markerchar=MSRP_Mean labelstrip;

 highlow x=Origin high=MSRP_UCLM low=MSRP_LCLM / group=DriveTrain highcap=serif lowcap=serif;
 scatter x=Origin y=MSRP / group=DriveTrain jitter markerattrs=(symbol=circlefilled size=5) transparency=0.50 clusterwidth=0.7;
 refline ref / lineattrs=(pattern=shortdash) label=label labelpos=max ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1667993919446.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77108i667283811BDC0C33/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1667993919446.png" alt="Ksharp_0-1667993919446.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 11:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgpanel-moving-refline-and-data-labels/m-p/843328#M333414</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-11-09T11:38:24Z</dc:date>
    </item>
  </channel>
</rss>

