<?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: Proc sgplot, collision of datalabels.  Can the positions be edited? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-collision-of-datalabels-Can-the-positions-be-edited/m-p/201022#M7499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By default, data labels in scatter plots use a collision-avoidance algorithm. In this case, the labels were so long that they did not fit in the graph. Therefore, they chose a default labeling position. You cannot specify the position of each label yourself, but here are some options to consider:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Choose a smaller font size via DATALABELATTRS.&lt;/P&gt;&lt;P&gt;2. Sometime using a higher image DPI (&amp;gt; 100) can give you enough space. Specify IMAGE_DPI on ODS destination you have open.&lt;/P&gt;&lt;P&gt;2. Specify a user-defined format to map the long string into a shorter name for labeling (this mapping could also be done in a data step).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Mar 2015 17:40:34 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2015-03-13T17:40:34Z</dc:date>
    <item>
      <title>Proc sgplot, collision of datalabels.  Can the positions be edited?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-collision-of-datalabels-Can-the-positions-be-edited/m-p/201021#M7498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;SAS version:&lt;/STRONG&gt; 9.04.01M1P120413&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;datalabels on scatter plot colliding.&amp;nbsp; Is there a way to move the labels, while keeping the dimensions of the graph as is?&amp;nbsp; For instance, can I make it so one label is above the point and the other label is below the point?&amp;nbsp; Or better yet, is there a way to click into the graph and manually move the labels?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Parameters: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. cannot rely on legend to identify points.&amp;nbsp; Points must be identified on the graph itself&lt;/P&gt;&lt;P&gt;2. cannot change dimensions.&amp;nbsp; it has to stay 5 by 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example data set and plot code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data fake;&lt;/P&gt;&lt;P&gt;input ID served SRVs UL LL;&lt;/P&gt;&lt;P&gt;if ID=1000087 then do;&lt;/P&gt;&lt;P&gt;label="really long name that was replaced because confidential";&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else if ID=1004937 then do;&lt;/P&gt;&lt;P&gt;label="another really long name replaced because confidential";&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 6 0 . .&lt;/P&gt;&lt;P&gt;3 6 0 . .&lt;/P&gt;&lt;P&gt;4 6 0 . .&lt;/P&gt;&lt;P&gt;5 6 0 . .&lt;/P&gt;&lt;P&gt;1000027 12 0 . .&lt;/P&gt;&lt;P&gt;1000129 11 0 . .&lt;/P&gt;&lt;P&gt;1000132 8 0 . .&lt;/P&gt;&lt;P&gt;1000132 10 0 . .&lt;/P&gt;&lt;P&gt;1000335 8 0 . .&lt;/P&gt;&lt;P&gt;1005796 7 0 . .&lt;/P&gt;&lt;P&gt;1005855 12 0 . .&lt;/P&gt;&lt;P&gt;2 4 1 . .&lt;/P&gt;&lt;P&gt;1000022 9 1 . .&lt;/P&gt;&lt;P&gt;1005725 13 1 . .&lt;/P&gt;&lt;P&gt;50 5 2 . .&lt;/P&gt;&lt;P&gt;67 6 2 . .&lt;/P&gt;&lt;P&gt;1000087 7 4 . .&lt;/P&gt;&lt;P&gt;1004937 4 4 . .&lt;/P&gt;&lt;P&gt;0 0 . 2.95692 0&lt;/P&gt;&lt;P&gt;0 2 . 2.97338 0&lt;/P&gt;&lt;P&gt;0 4 . 2.99016 0&lt;/P&gt;&lt;P&gt;0 6 . 3.00729 0&lt;/P&gt;&lt;P&gt;0 8 . 3.02478 0&lt;/P&gt;&lt;P&gt;0 10 . 3.04265 0&lt;/P&gt;&lt;P&gt;0 12 . 3.0609 0&lt;/P&gt;&lt;P&gt;0 14 . 3.07957 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics on /height=5in width=3in border=off;&lt;/P&gt;&lt;P&gt;proc sgplot data=fake;&lt;/P&gt;&lt;P&gt;title "Trends in SRVs for small providers";&lt;/P&gt;&lt;P&gt;band x=served upper=UL lower=LL / LEGENDLABEL= "typical range";&lt;/P&gt;&lt;P&gt;scatter x=served y=SRVs /&amp;nbsp; datalabel=Label LEGENDLABEL= "# SRVs for provider";&lt;/P&gt;&lt;P&gt;yaxis min=0 max=5 label='Number of SRVs' grid;&lt;/P&gt;&lt;P&gt;xaxis min=3 max=14 label='Number of consumers served' grid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11137i53C6EB0C1D592289/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="exampleplot.png" title="exampleplot.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 15:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-collision-of-datalabels-Can-the-positions-be-edited/m-p/201021#M7498</guid>
      <dc:creator>jessicasahut</dc:creator>
      <dc:date>2015-03-13T15:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot, collision of datalabels.  Can the positions be edited?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-collision-of-datalabels-Can-the-positions-be-edited/m-p/201022#M7499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By default, data labels in scatter plots use a collision-avoidance algorithm. In this case, the labels were so long that they did not fit in the graph. Therefore, they chose a default labeling position. You cannot specify the position of each label yourself, but here are some options to consider:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Choose a smaller font size via DATALABELATTRS.&lt;/P&gt;&lt;P&gt;2. Sometime using a higher image DPI (&amp;gt; 100) can give you enough space. Specify IMAGE_DPI on ODS destination you have open.&lt;/P&gt;&lt;P&gt;2. Specify a user-defined format to map the long string into a shorter name for labeling (this mapping could also be done in a data step).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 17:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-collision-of-datalabels-Can-the-positions-be-edited/m-p/201022#M7499</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2015-03-13T17:40:34Z</dc:date>
    </item>
  </channel>
</rss>

