<?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: Affixing variable to lines in graphs in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312323#M10995</link>
    <description>&lt;P&gt;Your suggested code is in the format I am using.&amp;nbsp; My problem is that I have 9 potential ID's that I am including in the group=ID.&amp;nbsp; However, sometimes that ID is missing.&amp;nbsp; At that point, SAS is reassigning my line assignements to skip the missing ID.&amp;nbsp; I need the line assignments to remain fixed, and skip that particular line in my graph.&amp;nbsp; Can that be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2016 13:18:06 GMT</pubDate>
    <dc:creator>still_learning</dc:creator>
    <dc:date>2016-11-17T13:18:06Z</dc:date>
    <item>
      <title>Affixing variable to lines in graphs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312314#M10993</link>
      <description>&lt;P&gt;I am trying to create multiple graphs for mulptiple locations using a fixed data set.&amp;nbsp; Some variables that I am sorting by do not exisit for some locations, causing my line assignments to change from location to location.&amp;nbsp; Is there a way for SAS to assign a variable to a line, and if that variable does not exist, not use that line in the graph?&amp;nbsp; In otherwords, the variable and line relationship&amp;nbsp;are constant, their appearance on the graph is dependent upon the presence of the variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 12:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312314#M10993</guid>
      <dc:creator>still_learning</dc:creator>
      <dc:date>2016-11-17T12:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Affixing variable to lines in graphs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312320#M10994</link>
      <description>&lt;P&gt;Some example data would help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like you have a BY variable, but you also have multiple Y variables, some of which are missing for certain values of the BY variable. Perhaps you are trying to plot something like this:&lt;/P&gt;
&lt;P&gt;proc sgplot;&lt;/P&gt;
&lt;P&gt;by State;&lt;/P&gt;
&lt;P&gt;series x=x y=Y1;&lt;/P&gt;
&lt;P&gt;series x=x y=Y2;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The better way to handle this is to conver the data from wide form to long form. See the article &lt;A href="http://blogs.sas.com/content/iml/2015/02/25/plotting-multiple-series-transforming-data-from-wide-to-long.html" target="_self"&gt;"Plotting multiple series: Transforming data from wide to long."&lt;/A&gt;&amp;nbsp; when the data are in long form, the BY-group levels can have different number of lines. The corresponding code might look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot;&lt;/P&gt;
&lt;P&gt;by State;&lt;/P&gt;
&lt;P&gt;series x=x y=value / group=ID;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 13:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312320#M10994</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-17T13:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Affixing variable to lines in graphs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312323#M10995</link>
      <description>&lt;P&gt;Your suggested code is in the format I am using.&amp;nbsp; My problem is that I have 9 potential ID's that I am including in the group=ID.&amp;nbsp; However, sometimes that ID is missing.&amp;nbsp; At that point, SAS is reassigning my line assignements to skip the missing ID.&amp;nbsp; I need the line assignments to remain fixed, and skip that particular line in my graph.&amp;nbsp; Can that be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 13:18:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312323#M10995</guid>
      <dc:creator>still_learning</dc:creator>
      <dc:date>2016-11-17T13:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Affixing variable to lines in graphs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312329#M10997</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Some example data would help. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Perhaps you are referring to the choice of colors and line patterns that are assigned to each ID. In that case, read about &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/" target="_self"&gt;discrete attribute maps&lt;/A&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2014/10/19/consistent-group-colors-by-value/" target="_self"&gt;Consistent group colors by values&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.sas.com/content/iml/2012/10/17/specify-the-colors-of-groups-in-sas-statistical-graphics.html" target="_self"&gt;Specify the colors of groups in SAS statistical graphics&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 17 Nov 2016 13:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312329#M10997</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-17T13:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Affixing variable to lines in graphs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312391#M11005</link>
      <description>&lt;P&gt;The best way to do that is to use a Discrete Attributes Map. &amp;nbsp;This is a sas data set in which you can specify, &lt;STRONG&gt;by value&lt;/STRONG&gt;, the attributes each classivication value should get. &amp;nbsp;So for Id=A, you can specify a color, symbol shape and line pattern. and so on. &amp;nbsp;Missing group values can be skipped by setting MISSING or MISSINGGROUP options. &amp;nbsp;Now, your id values will always retain their attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See: &amp;nbsp;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 17:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Affixing-variable-to-lines-in-graphs/m-p/312391#M11005</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-11-17T17:02:55Z</dc:date>
    </item>
  </channel>
</rss>

