<?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: Adding marker symbols on multiple pbslines in SAS Software for Learning Community</title>
    <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938442#M2015</link>
    <description>&lt;P&gt;Let's see if I understand. You have turned of the autolegend so any legend created by Group values will not have a description. then you added the Nomarkers option to Pbspline so no markers are displayed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you don't show any example of what you expect as the attachment shows an example of what the code generates, not what you want, we need some details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you want a marker. How do we know what that marker represents?&lt;/P&gt;
&lt;P&gt;Where would it go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps simplest would be to remove the NOAUTOLEGEND&amp;nbsp; then you get lines based on the current ODS Style (or overriden by the STYLEATTRS options or DATTRMAP dataset) and a legend that links the color /line pattern combinations to values of your group variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can take one pass through sgplot to generate a data set of the elements displayed in the graph and perhaps modify that. Here is an example based on an example of Pbspline plot in the documentation.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class
     noautolegend;
  pbspline x=height y=weight /group=sex;
  ods output sgplot=work.mysplineplot;
run;

proc sgplot data=work.mysplineplot;
  series x=PBSPLINE_HEIGHT_WEIGHT_GROUP___X 
         y=PBSPLINE_HEIGHT_WEIGHT_GROUP___Y
         /group=PBSPLINE_HEIGHT_WEIGHT_GROUP__GP
          markers
;
run;&lt;/PRE&gt;
&lt;P&gt;The ODS OUTPUT creates a data set. The second is a simple example of replotting the spline as series plot.&lt;/P&gt;
&lt;P&gt;Note that depending on YOUR data the variable names would change and the number of points in the spline part of the plot. Notice that part of this plot may look like a very fat line because of the interval between the spline resulting points is close and the markers overlap.&lt;/P&gt;
&lt;P&gt;One way to reduce the number of markers is to add another variable to the spline plot data that will use a marker based on the group variable and plot that with a scatter plot.&lt;/P&gt;
&lt;PRE&gt;data work.toplot;
   set work.mysplineplot;
   rename PBSPLINE_HEIGHT_WEIGHT_GROUP___X=splinex
          PBSPLINE_HEIGHT_WEIGHT_GROUP___Y=spliney
          PBSPLINE_HEIGHT_WEIGHT_GROUP__GP=splinegroup
   ;

   if mod(_n_,10)=5 then markery=PBSPLINE_HEIGHT_WEIGHT_GROUP___Y;
run;

proc sgplot data=work.toplot;
  series x=splinex 
         y=spliney
         /group=splinegroup
  ;
  scatter x=splinex
          y=markery
          /group=splinegroup
   ;
   label  markery='Weight'
   ;
run;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Aug 2024 22:19:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-08-06T22:19:09Z</dc:date>
    <item>
      <title>Adding marker symbols on multiple pbslines</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938436#M2014</link>
      <description>&lt;P&gt;Good afternoon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to have multiple pbslines created by sgplot.&lt;/P&gt;&lt;P&gt;I have succeded.&lt;/P&gt;&lt;P&gt;However, because of grahical presentation, I would like to have each line accompanied by a symbol (circel, squarefilled, etc) to better identify them when they are 8 lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I got (I also changed with combination of linepatterns, i.e not only solid)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SEE ATTACHMENT FOR THE FIGURE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...with this SAS syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title "ALL";&lt;/P&gt;&lt;P&gt;proc sgplot data= r5 nocycleattrs noautolegend;&lt;/P&gt;&lt;P&gt;styleattrs datacontrastcolors=(red blue)&lt;/P&gt;&lt;P&gt;datalinepatterns=(solid solid )&lt;/P&gt;&lt;P&gt;datasymbols=(triangle circlefilled);&lt;/P&gt;&lt;P&gt;pbspline y=lpwv10 x=time / group= byebye nomarkers smooth=50 nknots=5&lt;/P&gt;&lt;P&gt;lineattrs= (thickness=3) ;&lt;/P&gt;&lt;P&gt;xaxis values= (2 to 7 by 1) label= 'Time (years)';&lt;/P&gt;&lt;P&gt;yaxis values= (0 to 0.5 by 0.1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No way to get what I am looking for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Angelo S&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 21:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938436#M2014</guid>
      <dc:creator>angeloelefante</dc:creator>
      <dc:date>2024-08-06T21:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding marker symbols on multiple pbslines</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938442#M2015</link>
      <description>&lt;P&gt;Let's see if I understand. You have turned of the autolegend so any legend created by Group values will not have a description. then you added the Nomarkers option to Pbspline so no markers are displayed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you don't show any example of what you expect as the attachment shows an example of what the code generates, not what you want, we need some details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you want a marker. How do we know what that marker represents?&lt;/P&gt;
&lt;P&gt;Where would it go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps simplest would be to remove the NOAUTOLEGEND&amp;nbsp; then you get lines based on the current ODS Style (or overriden by the STYLEATTRS options or DATTRMAP dataset) and a legend that links the color /line pattern combinations to values of your group variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can take one pass through sgplot to generate a data set of the elements displayed in the graph and perhaps modify that. Here is an example based on an example of Pbspline plot in the documentation.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class
     noautolegend;
  pbspline x=height y=weight /group=sex;
  ods output sgplot=work.mysplineplot;
run;

proc sgplot data=work.mysplineplot;
  series x=PBSPLINE_HEIGHT_WEIGHT_GROUP___X 
         y=PBSPLINE_HEIGHT_WEIGHT_GROUP___Y
         /group=PBSPLINE_HEIGHT_WEIGHT_GROUP__GP
          markers
;
run;&lt;/PRE&gt;
&lt;P&gt;The ODS OUTPUT creates a data set. The second is a simple example of replotting the spline as series plot.&lt;/P&gt;
&lt;P&gt;Note that depending on YOUR data the variable names would change and the number of points in the spline part of the plot. Notice that part of this plot may look like a very fat line because of the interval between the spline resulting points is close and the markers overlap.&lt;/P&gt;
&lt;P&gt;One way to reduce the number of markers is to add another variable to the spline plot data that will use a marker based on the group variable and plot that with a scatter plot.&lt;/P&gt;
&lt;PRE&gt;data work.toplot;
   set work.mysplineplot;
   rename PBSPLINE_HEIGHT_WEIGHT_GROUP___X=splinex
          PBSPLINE_HEIGHT_WEIGHT_GROUP___Y=spliney
          PBSPLINE_HEIGHT_WEIGHT_GROUP__GP=splinegroup
   ;

   if mod(_n_,10)=5 then markery=PBSPLINE_HEIGHT_WEIGHT_GROUP___Y;
run;

proc sgplot data=work.toplot;
  series x=splinex 
         y=spliney
         /group=splinegroup
  ;
  scatter x=splinex
          y=markery
          /group=splinegroup
   ;
   label  markery='Weight'
   ;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Aug 2024 22:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938442#M2015</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-06T22:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding marker symbols on multiple pbslines</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938491#M2016</link>
      <description>Thanks for your reply&lt;BR /&gt;Thanks also for asking what I really want.&lt;BR /&gt;I start from this&lt;BR /&gt;I am not interested to have markers of individual data.&lt;BR /&gt;As you indicated, the interval between data is such that I get a "fat line"&lt;BR /&gt;I would like to have a way to identify groups by a solid line with a marker&lt;BR /&gt;For instance, Group 1 has a solid red line with traingel, group 2 a solid redline with filled circle, group 3 a solid blue line with diamonds, etc&lt;BR /&gt;&lt;BR /&gt;I see Figure 23.38 at page 708 of the "SAS/STAT 15.2® User’s Guide&lt;BR /&gt;Statistical Graphics Using ODS" indicating that my desired style is part of the Default language&lt;BR /&gt;However, I am not able to get those lines&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Angelo</description>
      <pubDate>Wed, 07 Aug 2024 10:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Adding-marker-symbols-on-multiple-pbslines/m-p/938491#M2016</guid>
      <dc:creator>angeloelefante</dc:creator>
      <dc:date>2024-08-07T10:06:41Z</dc:date>
    </item>
  </channel>
</rss>

