<?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 Modifying the datalabel position in SGplot to be directly above the marker in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184647#M6800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a plot where I would like the datalabels to be positioned directly above the marker. In the code below, sometimes the datalabel is directly above the marker, but most of the time the default seems to be to have the datalabel off to the side of the marker. How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Cand1;&lt;BR /&gt;Input Domain $ Items PercM SE LowerL UpperH;&lt;BR /&gt;Cards;&lt;BR /&gt;D1 44 86 80 78 94 &lt;BR /&gt;D2 30 73 10 63 83 &lt;BR /&gt;D3 38 79 90 70 88 &lt;BR /&gt;D4 13 69 13 56 82 &lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sort data=cand1; &lt;BR /&gt; by descending domain;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data= Cand1 noautolegend nocycleattrs&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; scatter y=Domain x=PercM / datalabel=PercM datalabelattrs=(size=12 weight=bold) markerattrs=(symbol=plus);&lt;BR /&gt;&amp;nbsp; scatter y=Domain x=LowerL /&amp;nbsp; datalabel=LowerL datalabelattrs=(size=9) markerattrs=(symbol=plus)&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; scatter y=Domain x=UpperH /&amp;nbsp; datalabel=UpperH datalabelattrs=(size=9) markerattrs=(symbol=plus)&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; highlow y=Domain low=LowerL high=UpperH&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; xaxis label="Percent Correct" values=(0,20,40,60,80,100) ;&lt;BR /&gt;&amp;nbsp; yaxis label="Domain" discreteorder=data;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jan 2015 15:55:15 GMT</pubDate>
    <dc:creator>AD</dc:creator>
    <dc:date>2015-01-15T15:55:15Z</dc:date>
    <item>
      <title>Modifying the datalabel position in SGplot to be directly above the marker</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184647#M6800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a plot where I would like the datalabels to be positioned directly above the marker. In the code below, sometimes the datalabel is directly above the marker, but most of the time the default seems to be to have the datalabel off to the side of the marker. How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Cand1;&lt;BR /&gt;Input Domain $ Items PercM SE LowerL UpperH;&lt;BR /&gt;Cards;&lt;BR /&gt;D1 44 86 80 78 94 &lt;BR /&gt;D2 30 73 10 63 83 &lt;BR /&gt;D3 38 79 90 70 88 &lt;BR /&gt;D4 13 69 13 56 82 &lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sort data=cand1; &lt;BR /&gt; by descending domain;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data= Cand1 noautolegend nocycleattrs&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; scatter y=Domain x=PercM / datalabel=PercM datalabelattrs=(size=12 weight=bold) markerattrs=(symbol=plus);&lt;BR /&gt;&amp;nbsp; scatter y=Domain x=LowerL /&amp;nbsp; datalabel=LowerL datalabelattrs=(size=9) markerattrs=(symbol=plus)&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; scatter y=Domain x=UpperH /&amp;nbsp; datalabel=UpperH datalabelattrs=(size=9) markerattrs=(symbol=plus)&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; highlow y=Domain low=LowerL high=UpperH&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; xaxis label="Percent Correct" values=(0,20,40,60,80,100) ;&lt;BR /&gt;&amp;nbsp; yaxis label="Domain" discreteorder=data;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184647#M6800</guid>
      <dc:creator>AD</dc:creator>
      <dc:date>2015-01-15T15:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying the datalabel position in SGplot to be directly above the marker</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184648#M6801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of SAS are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184648#M6801</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2015-01-15T16:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying the datalabel position in SGplot to be directly above the marker</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184649#M6802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to Proc Product_status (I'm using EG), the SAS version is 9.3_M1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184649#M6802</guid>
      <dc:creator>AD</dc:creator>
      <dc:date>2015-01-15T16:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying the datalabel position in SGplot to be directly above the marker</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184650#M6803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the DATALABELPOS option for SCATTER plots was not surface in the SG procedures until SAS 9.4. However, The code below is a neat alternative. Basically, it plots the labels separately from the scatter points. The DISCRETEOFFSET option offsets the "labeling" scatter plot to raise the labels above the scatter points. The FORMAT is required to trim the excess space and center the labels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data= Cand1 noautolegend nocycleattrs;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format PercM LowerL UpperH 2.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter y=Domain x=PercM / markerattrs=(symbol=plus);&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter y=Domain x=LowerL /&amp;nbsp; markerattrs=(symbol=plus)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter y=Domain x=UpperH /&amp;nbsp; markerattrs=(symbol=plus)&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter y=Domain x=PercM / markerchar=PercM markercharattrs=(size=12 weight=bold) discreteoffset=0.12;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter y=Domain x=LowerL /&amp;nbsp; markerchar=LowerL markercharattrs=(size=9) discreteoffset=0.12;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter y=Domain x=UpperH /&amp;nbsp; markerchar=UpperH markercharattrs=(size=9) discreteoffset=0.12;&lt;/P&gt;&lt;P&gt;&amp;nbsp; highlow y=Domain low=LowerL high=UpperH&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis label="Percent Correct" values=(0,20,40,60,80,100) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; yaxis label="Domain" discreteorder=data;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 18:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184650#M6803</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2015-01-15T18:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying the datalabel position in SGplot to be directly above the marker</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184651#M6804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, thanks! Works perfectly. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 19:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-the-datalabel-position-in-SGplot-to-be-directly-above/m-p/184651#M6804</guid>
      <dc:creator>AD</dc:creator>
      <dc:date>2015-01-15T19:13:11Z</dc:date>
    </item>
  </channel>
</rss>

