<?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: Symbols in a scatterplot with grouped data in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178321#M6546</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's great! Oh yes I remember when I initially had problems when using dattrmaps with formats...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jan 2015 14:43:34 GMT</pubDate>
    <dc:creator>djrisks</dc:creator>
    <dc:date>2015-01-12T14:43:34Z</dc:date>
    <item>
      <title>Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178316#M6541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm experimenting with ods graphics to create a scatterplot for a grouped variable with two categories. The values are marked by a circle and a plus sign but I'd prefer to use 'X' and 'Y'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I assumed it should be done:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgscatter data=mydata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; plot myXvar*mYvar / group=myGroup|Var MARKERATTRS=GraphData1(symbol=X) MARKERATTRS=GraphData2(symbol=Y);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this sets the symbols in both groups to "Y", the first markerattrs option is ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the SAS 9.4 documentation:&lt;/P&gt;&lt;H4 class="xis-argument"&gt;MARKERATTRS=&lt;SPAN class="xis-userSuppliedValue"&gt;style-element&lt;/SPAN&gt; &lt;SPAN class="xis-argOption"&gt;&amp;lt;(&lt;SPAN class="xis-userSuppliedValue"&gt;options&lt;/SPAN&gt;)&amp;gt;&lt;/SPAN&gt; | (&lt;SPAN class="xis-userSuppliedValue"&gt;options&lt;/SPAN&gt;)&amp;nbsp; &lt;/H4&gt;&lt;P&gt;GraphData1 ... GraphData&lt;SPAN class="xis-userSuppliedValue"&gt;n&lt;/SPAN&gt; style elements in the current style for grouped data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/grstatproc/67924/HTML/default/viewer.htm#p1b2ff69nyh0ghn1lxlkzwkspro0.htm" title="http://support.sas.com/documentation/cdl/en/grstatproc/67924/HTML/default/viewer.htm#p1b2ff69nyh0ghn1lxlkzwkspro0.htm"&gt;SAS(R) 9.4 ODS Graphics: Procedures Guide, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to do this would be to use a modified template but I'd prefer not to do it that way. I use Enterprise Guide to develop the program, using a template would complicate matters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to create separate symbols using the markerattrs options in sgscatter (or another ods graphics procedure? I'm using SAS 9.4 with EG 6.1. I'm using the "analysis" style for the ods graphics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 10:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178316#M6541</guid>
      <dc:creator>ckx</dc:creator>
      <dc:date>2015-01-12T10:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178317#M6542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are at least two ways to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the simpler ways is to use the marker character option, as in the example below. However, the legend does not contain the X and Y. All you need to do is adapt the program so that one of your groups are assigned the letter "X" and the other group is assigned the letter "Y".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because you have SAS 9.4 though, it might be better if you use the Attribute maps option, as also shown in the example further below. This also gives you the X and Y symbols on your legend.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data cars;&lt;BR /&gt;&amp;nbsp; set sashelp.cars;&lt;BR /&gt;&amp;nbsp; where make in ("Acura","Audi");&lt;BR /&gt;&amp;nbsp; if make = "Acura" then Groupmarker = "X";&lt;BR /&gt;&amp;nbsp; else if make = "Audi" then Groupmarker = "Y";&lt;BR /&gt;&amp;nbsp; keep make cylinders horsepower Groupmarker;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Using Markercharacter option */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data = cars;&lt;BR /&gt;&amp;nbsp; scatter x = CYLINDERS y = HORSEPOWER / group = make markercharacter = Groupmarker;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data myattrmap;&lt;BR /&gt;&amp;nbsp; input ID $ value $ markersymbol $ ;&lt;BR /&gt;&amp;nbsp; datalines;&lt;BR /&gt;&amp;nbsp; myid&amp;nbsp; Acura X &lt;BR /&gt;&amp;nbsp; myid&amp;nbsp; Audi Y&lt;BR /&gt;&amp;nbsp; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Using Attribute Maps */&lt;/P&gt;&lt;P&gt;proc sgplot data=cars dattrmap=myattrmap;&lt;BR /&gt;&amp;nbsp; scatter x = CYLINDERS y = HORSEPOWER / group = make attrid=myid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 10:27:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178317#M6542</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-01-12T10:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178318#M6543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply, it worked brilliantly! I'm particularly happy to learn about the dattrmap option, that adds a lot of flexibiltiy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 11:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178318#M6543</guid>
      <dc:creator>ckx</dc:creator>
      <dc:date>2015-01-12T11:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178319#M6544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome. Yes that's correct Attribute Maps add a lot of flexibility! Did you use the dattrmap option for your example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 13:19:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178319#M6544</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-01-12T13:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178320#M6545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried both options.The dattrmap option gave me a spot of trouble because I had a numeric grouping variable. After some experimentation I found that creating the variable VALUE from the formatted values of my group variable worked great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 14:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178320#M6545</guid>
      <dc:creator>ckx</dc:creator>
      <dc:date>2015-01-12T14:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178321#M6546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's great! Oh yes I remember when I initially had problems when using dattrmaps with formats...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 14:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178321#M6546</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-01-12T14:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178322#M6547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have SAS 9.4M1, the right way to do this is using the SYMBOLCHAR statement.&amp;nbsp; This statement allows you to define a marker from any Unicode font symbol.&amp;nbsp; The legend will also include the symbol.&amp;nbsp; See example code below.&amp;nbsp; There is also a similar SYMBOLIMAGE statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp; symbolchar name=X&amp;nbsp; char='0058'x / scale=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; symbolchar name=Y&amp;nbsp; char='0059'x / scale=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; styleattrs datasymbols=(X Y);&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter x=height y=weight / group=sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 15:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178322#M6547</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-01-12T15:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178323#M6548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes indeed, the symbolchar method works as well. I think I would still prefer the dattrmap option because the documentation seems to be clearer. But that's just a ver first impression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 08:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178323#M6548</guid>
      <dc:creator>ckx</dc:creator>
      <dc:date>2015-01-13T08:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178324#M6549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For future reference, with SAS 9.4, all you really need is a STYLEATTRS statement as shown below.&amp;nbsp; You can use StyleAttrs to set group symbols, colors, line patterns,etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=cars;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;styleattrs datasymbols=(x y);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; scatter x = CYLINDERS y = HORSEPOWER / group = make;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STYLEATTRS was added at SAS 9.4.&amp;nbsp; With SAS 9.3, Attrmap is the way to go, and is effectively doing the same thing.&amp;nbsp; Yes, this can be a bit confusing, but that is the price of having a system that is being actively enhanced.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you need some symbol that is not included in the pre-defined list, you can define it using SYMBOLCHAR, and then use StyleAttrs or Attrmap to include it in the list of group symbols.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 14:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178324#M6549</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-01-13T14:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178325#M6550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of interest, does Styleattrs work with the group = variable? If so what will happen if you use more than one group = variable please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178325#M6550</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-01-13T15:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178326#M6551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it works with group case, and also for direct assignment of attributes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STYLEATTRS is simply an easy, in-line code way to change the GraphData1-12 elements in the active style.&amp;nbsp; Instead of having to derive a new style with the changed group values, you can define the new values in the SGPLOT code itself.&amp;nbsp; This is a easy way for a quick, non persistent change.&amp;nbsp; For persistent change, it is still better to derive a corporate style.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STYLEATTRS has four bundles:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DATACOLORS for the fill colors,&lt;/LI&gt;&lt;LI&gt;DATACONTRASTCOLORS for the line and marker colors,&lt;/LI&gt;&lt;LI&gt;DATASYMBOLS&lt;/LI&gt;&lt;LI&gt;DATALINEPATTERNS.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The list you provide &lt;STRONG&gt;REPLACES &lt;/STRONG&gt;the list from the style.&amp;nbsp; In the case above, I changed the Symbols list to (X, Y).&amp;nbsp; So, now the graph will cycle through only these two marker symbols.&amp;nbsp; All other group lists will stay unchanged.&amp;nbsp; For symbols, you can include the pre-defined symbol names (like Circle, CircleFilled, etc), or a new symbol name created using the SYMBOLCHAR or SYMBOLIMAGE statements.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also remember, the HTMLBlue style has ATTRPRIORITY=COLOR.&amp;nbsp; So, symbols change only after the colors are exhausted. To see symbol cycling, use a different style, or set ATTRPRIORITY=NONE in the ODS Graphics statement.&amp;nbsp; Sounds like a good topic for a blog article.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 16:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178326#M6551</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-01-13T16:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178327#M6552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the explantion!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks so easy to use, and it appears that the Colors and Symbols can be changed simultaneously. It's a welcomed upgrade to the %modstyle macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree, it sounds like a good topic for Graphically Speaking &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 18:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178327#M6552</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-01-13T18:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Symbols in a scatterplot with grouped data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178328#M6553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2015/01/14/marker-symbols/" title="http://blogs.sas.com/content/graphicallyspeaking/2015/01/14/marker-symbols/"&gt; Marker Symbols - Graphically Speaking&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 18:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Symbols-in-a-scatterplot-with-grouped-data/m-p/178328#M6553</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-01-14T18:21:53Z</dc:date>
    </item>
  </channel>
</rss>

