<?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: Plots in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967802#M48634</link>
    <description>&lt;P&gt;Repeating the instructions I gave earlier:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paste your code into the code box (it pops up when you click on the "little running man" icon)&lt;/P&gt;</description>
    <pubDate>Fri, 30 May 2025 14:34:02 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2025-05-30T14:34:02Z</dc:date>
    <item>
      <title>Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967576#M48614</link>
      <description>&lt;P&gt;Hi all good morning&lt;/P&gt;&lt;P&gt;I would like to ask you how I can change symbols in SGPLOT procedure for different groups using scatter and series.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;José Eduardo&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 12:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967576#M48614</guid>
      <dc:creator>josecorrente</dc:creator>
      <dc:date>2025-05-28T12:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967579#M48615</link>
      <description>&lt;P&gt;If you have multiple groups on a plot, you can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1dt33l6a6epk6n1chtynsgsjgit.htm" target="_self"&gt;STYLEATTRS command&lt;/A&gt; in PROC SGPLOT to designate symbols for each group, and specify the desired symbols in the DATASYMBOLS= option.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
    styleattrs datasymbols=(diamond circle) datacontrastcolors=(red green);
    scatter x=height y=weight / group=sex;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 13:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967579#M48615</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-28T13:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967770#M48631</link>
      <description>Hi pagemiller&lt;BR /&gt;Thank you for your reply. The problem is I am using scatter and series at the same plot (overlaid) and I am not get different symbols for grous. Using styleattrs it considers only the last symbol. The colors are ok. Do you have any suggestions to use different symbols? Thanks in advance.</description>
      <pubDate>Fri, 30 May 2025 11:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967770#M48631</guid>
      <dc:creator>josecorrente</dc:creator>
      <dc:date>2025-05-30T11:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967772#M48632</link>
      <description>&lt;P&gt;Show us the code you are using. Paste your code into the code box (it pops up when you click on the "little running man" icon)&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 11:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967772#M48632</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-30T11:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967789#M48633</link>
      <description>Hi pagemiller&lt;BR /&gt;The code is:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=Out11;&lt;BR /&gt;styleattrs datasymbols=(diamond circle ) datacontrastcolors=(black grey )&lt;BR /&gt;datalinepatterns=(solid dot );&lt;BR /&gt;scatter y=mean x=time /group=zygosity markerattrs=( size=6 );;&lt;BR /&gt;series y=pred x=time /group=zygosity markerattrs=( size=6 );&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;The scatter plot is for the observations and the series is for a b-spline fit for these data.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 30 May 2025 14:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967789#M48633</guid>
      <dc:creator>josecorrente</dc:creator>
      <dc:date>2025-05-30T14:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967802#M48634</link>
      <description>&lt;P&gt;Repeating the instructions I gave earlier:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paste your code into the code box (it pops up when you click on the "little running man" icon)&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 14:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967802#M48634</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-30T14:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967853#M48636</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;I am not getting different symbols for groups.&lt;/EM&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;First, you might want to read an article that describes &lt;A href="https://blogs.sas.com/content/iml/2018/06/13/attrpriority-cycleattrs-styleattrs-ods-graphics.html" target="_self"&gt;the interaction between ATTRPRIORITY, CYCLEATTRS, and STYLEATTRS in ODS graphics.&lt;/A&gt;&amp;nbsp;It might be that what you are seeing (or what you want to see) requires that you understand how these options interact.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;It sounds like you might want to use ATTRPRIORITY=NONE, which enables the symbol to automatically change for different groups.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Since we don't have your data, let's use data that we all have. The following creates some data for this example that (hopefully!) is similar to yours:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Out;
set sashelp.stocks(keep=Stock Date Open where=(Date&amp;lt;'01JAN1991'd));
rename date=Time Open=mean;
run;
proc sort data=Out;
  by Time Stock;
run;
/* write spline predictor to OUT2 data set in the PRED variable */
proc glmselect data=Out;
  effect spl = spline(Time / basis=bspline knotmethod=equal(9));
  class Stock;
  model mean = spl | stock / selection=none;
  output out=out2 pred=pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now let's graph the data. The following sets ATTRPRIORITY=NONE and lets the symbols, colors, and line styles change according to the ODS style.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics / AttrPriority=NONE;
proc sgplot data=Out2;
   scatter y=mean x=time /group=Stock;
   series y=pred x=time / group=Stock;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output is below. Note that the colors, symbols, and line patterns are different for all groups.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rick_SAS_0-1748633847670.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107471i96BEE80D4CFAD3F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rick_SAS_0-1748633847670.png" alt="Rick_SAS_0-1748633847670.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you want to override the default colors or symbols or patterns, you can use the STYLEATTRS statement, as Paige suggested. You can override 1, 2, or all three attributes. In the following, I set all line patterns to SOLID, but specify colors and patterns for the markers and lines:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics / AttrPriority=NONE;
proc sgplot data=Out2;
   styleattrs datalinepatterns=(solid)
              datacontrastcolors=(SteelBlue DarkGreen DarkRed)
              datasymbols=(CircleFilled TriangleFilled X);
   scatter y=mean x=time /group=Stock markerattrs=( size=6 );
   series y=pred x=time / group=Stock;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rick_SAS_1-1748634013483.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107472i92BDF29994EE4136/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rick_SAS_1-1748634013483.png" alt="Rick_SAS_1-1748634013483.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please read the article and study the examples. Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 19:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967853#M48636</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-05-30T19:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967878#M48638</link>
      <description>&lt;P&gt;I used to create plots where different groups are displayed in different color and line patterns and therefore encountered the AttrPriority option in ODS GRAPHICS. I read the relevant introduction to that option given in SAS Help, but I was still rather confused on its utility. Could you please briefly explain it? Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 07:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967878#M48638</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-05-31T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967879#M48639</link>
      <description>&lt;P&gt;Yes, happy to. Please see &lt;A style="font-family: inherit; background-color: #ffffff;" href="https://blogs.sas.com/content/iml/2018/06/13/attrpriority-cycleattrs-styleattrs-ods-graphics.html" target="_blank"&gt;Attrs, attrs, everywhere: The interaction between ATTRPRIORITY, CYCLEATTRS, and STYLEATTRS in ODS graphics - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and the links therein.&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 10:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967879#M48639</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-05-31T10:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967880#M48640</link>
      <description>Thank you so much for a response well more informative than I originally anticipated! Have a nice weekend!</description>
      <pubDate>Sat, 31 May 2025 14:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/967880#M48640</guid>
      <dc:creator>Season</dc:creator>
      <dc:date>2025-05-31T14:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Plots</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/968180#M48659</link>
      <description>Thank you very much for you reply. I will read the article and try in my data. Sincerely&lt;BR /&gt;Jose Eduardo</description>
      <pubDate>Wed, 04 Jun 2025 19:14:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Plots/m-p/968180#M48659</guid>
      <dc:creator>josecorrente</dc:creator>
      <dc:date>2025-06-04T19:14:44Z</dc:date>
    </item>
  </channel>
</rss>

