<?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: How to label certain points in a 3D scatter plot in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339683#M63176</link>
    <description>&lt;P&gt;Please describe exactly what you mean by :&lt;/P&gt;
&lt;P&gt;I don't get the expected labelled point in the G3D graph, any helps?&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean there are labels in the result you did not expect? Describe or list the labels you did not expect.&lt;/P&gt;
&lt;P&gt;Are there expected labels not present (describe which ones are missing and the expected label)&lt;/P&gt;
&lt;P&gt;Is the label present but the text incorrect?&lt;/P&gt;
&lt;P&gt;Are there labels for points not present?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is hard to address an expectation without understanding what is expected.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 15:47:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-03-09T15:47:17Z</dc:date>
    <item>
      <title>How to label certain points in a 3D scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339537#M63166</link>
      <description>&lt;P&gt;I learned there are a similar post of "How to label certain points in a scatter plot", however this time I try to label some points in 3D scatter plot (PROC G3D)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the program I come up after l learned the post above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Set the graphics environment */&lt;BR /&gt;goptions reset=all border cback=white htitle=12pt;&lt;BR /&gt;&lt;BR /&gt;/* Create data set WORK.NUMS using */&lt;BR /&gt;/* a set of randomly sampled points */&lt;BR /&gt;data nums;&lt;BR /&gt;keep x y z ID;&lt;BR /&gt;do i=1 to 30;&lt;BR /&gt;x=10*ranuni(33)-5;&lt;BR /&gt;y=10*ranuni(35)-5;&lt;BR /&gt;z=sin(sqrt(x*x+y*y));&lt;BR /&gt;ID = i;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;data labels;&lt;BR /&gt;length text $2;&lt;BR /&gt;retain xsys ysys '2' hsys '3' function 'label' position '2' style '"calibri"';&lt;BR /&gt;set nums;&lt;BR /&gt;where y ge 2;&lt;BR /&gt;text = left(id);&lt;BR /&gt;run;&lt;BR /&gt;/* Define a title for the graph */&lt;BR /&gt;title1 'Scatter Plot of NUMS Data Set';&lt;/P&gt;&lt;P&gt;/* Generate the scatter plot */&lt;BR /&gt;proc g3d data=nums anno=labels;;&lt;BR /&gt;scatter y*x=z;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I turn to IRIS data, and label some points as well as their group, I have some troubles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Create data set WORK.IRIS2 */&lt;BR /&gt;data iris2;&lt;BR /&gt;set sashelp.iris;&lt;BR /&gt;length Species $12. Colorval $8. Shapeval $8.;&lt;BR /&gt;if species='Setosa' then&lt;BR /&gt;do;&lt;BR /&gt;shapeval='club';&lt;BR /&gt;colorval='vibg';&lt;BR /&gt;end;&lt;BR /&gt;if species='Versicolor' then&lt;BR /&gt;do;&lt;BR /&gt;shapeval='diamond';&lt;BR /&gt;colorval='depk';&lt;BR /&gt;end;&lt;BR /&gt;if species='Virginica' then&lt;BR /&gt;do;&lt;BR /&gt;shapeval='spade';&lt;BR /&gt;colorval='dabg' ;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data labels1;&lt;BR /&gt;length text $3;&lt;BR /&gt;retain xsys ysys '2' hsys '3' function 'label' position '2' style '"calibri"';&lt;BR /&gt;set sashelp.iris (rename=( PetalLength = y PetalWidth=x));&lt;BR /&gt;text = left(_N_);&lt;BR /&gt;run;&lt;BR /&gt;data labels;&lt;BR /&gt;set labels1;&lt;BR /&gt;where y GE 60;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Define titles and footnotes for graph */&lt;BR /&gt;title1 'Iris Species Classification';&lt;BR /&gt;title2 'Physical Measurement';&lt;BR /&gt;title3 'Source: Fisher (1936) Iris Data';&lt;BR /&gt;footnote1 j=l ' Petallen: Petal Length in mm.'&lt;BR /&gt;j=r 'Petalwid: Petal Width in mm. ';&lt;BR /&gt;footnote2 j=l ' Sepallen: Sepal Length in mm.'&lt;BR /&gt;j=r 'Sepal Width not shown ';&lt;BR /&gt;footnote3 ' ';&lt;/P&gt;&lt;P&gt;/* Create the graph using a NOTE statement */&lt;BR /&gt;/* to create the legend */&lt;BR /&gt;proc g3d data=iris2 anno=labels;&lt;BR /&gt;scatter PetalLength*PetalWidth=SepalLength&lt;BR /&gt;/ color=colorval&lt;BR /&gt;shape=shapeval;&lt;/P&gt;&lt;P&gt;/* Create a legend using NOTE statements */&lt;BR /&gt;note;&lt;BR /&gt;note j=r 'Species: ' c=dabg 'Virginica '&lt;BR /&gt;j=r c=depk ' Versicolor '&lt;BR /&gt;j=r c=vibg 'Setosa ';&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't get the expected labelled point in the G3D graph, any helps?&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 04:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339537#M63166</guid>
      <dc:creator>tanlianwm</dc:creator>
      <dc:date>2017-03-09T04:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to label certain points in a 3D scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339683#M63176</link>
      <description>&lt;P&gt;Please describe exactly what you mean by :&lt;/P&gt;
&lt;P&gt;I don't get the expected labelled point in the G3D graph, any helps?&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean there are labels in the result you did not expect? Describe or list the labels you did not expect.&lt;/P&gt;
&lt;P&gt;Are there expected labels not present (describe which ones are missing and the expected label)&lt;/P&gt;
&lt;P&gt;Is the label present but the text incorrect?&lt;/P&gt;
&lt;P&gt;Are there labels for points not present?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is hard to address an expectation without understanding what is expected.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339683#M63176</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-09T15:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to label certain points in a 3D scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339689#M63177</link>
      <description>&lt;P&gt;sorry about the confusion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the first program is the label points I expect,&amp;nbsp;I labelled all points with y greater than 2 by using&amp;nbsp;their corresponding ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, once the data is grouped into different categoies, as it is shown in the second program. There are three s&lt;SPAN&gt;pecies in IRIS data, and they will be marked as three different color and shapes. In that case, if I want to label all points with y greater than 60 by using their corresponding ID, I can't get the label as the previous example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hopefully I clearly express my concern, any suggestion will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/339689#M63177</guid>
      <dc:creator>tanlianwm</dc:creator>
      <dc:date>2017-03-09T15:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to label certain points in a 3D scatter plot</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/340057#M63206</link>
      <description>&lt;P&gt;I FIGURE IT OUT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHEN PREPRAING THE ANNO DATA, WE HAVE TO CONSIDER 'Z' BESIDES X , AND Y, &amp;nbsp;SINCE IT IS A &amp;nbsp;3-D GRAPH.&lt;/P&gt;&lt;P&gt;data labels1;&lt;BR /&gt;length text $3;&lt;BR /&gt;retain xsys ysys '2' hsys '3' function 'label' position '2' style '"calibri"';&lt;BR /&gt;set sashelp.iris (rename=( PetalLength = y PetalWidth=x SepalLength = Z));&lt;BR /&gt;text = left(_N_);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 18:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-label-certain-points-in-a-3D-scatter-plot/m-p/340057#M63206</guid>
      <dc:creator>tanlianwm</dc:creator>
      <dc:date>2017-03-10T18:52:05Z</dc:date>
    </item>
  </channel>
</rss>

