<?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: SGPLOT how to specify line color/thickness for a bunch of lines?! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982702#M379372</link>
    <description>&lt;P&gt;styleattrs datacontrastcolors=(lime red purple skyblue) ;&amp;nbsp; Works. But does not take linepatterns[or thinkness] anymore.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The title, I will leave alone. It is generated with macro. TVar stands for Target Variable. If spell out, need many lines since of invocations with variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;85               proc sgplot data=_t_mm_temp_coll_n_t(where=(xahead in (0, 5, 10,20)));
86                               by tvar;
87                               styleattrs datacontrastcolors=(lime red purple skyblue) ;
88                               styleattrs DATALINEPATTERNS=(1 2 4 15);
89                               series x=ncut y= cttot/ group =xahead ;
90                               yaxis max=500 min=450;
91                               refline  490/axis=y lineattrs=(color=red thickness=2
91 ! pattern=solid);
92                               refline  480/axis=y lineattrs=(color=cyan thickness=1
92 ! pattern=solid);
93                           run;

93 !                             quit;
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.37 seconds
      cpu time            0.06 seconds

NOTE: This graph has ATTRPRIORITY=COLOR in effect. The cycling of your custom symbols and/or line
      patterns is based on color priority. Please see ODS Graphics documentation on ATTRPRIORITY=
      option.
NOTE: This graph has ATTRPRIORITY=COLOR in effect. The cycling of your custom symbols and/or line
      patterns is based on color priority. Please see ODS Graphics documentation on ATTRPRIORITY=
      option.
NOTE: There were 64 observations read from the data set WORK._T_MM_TEMP_COLL_N_T.
      WHERE xahead in (0, 5, 10, 20);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 30 Jan 2026 08:05:04 GMT</pubDate>
    <dc:creator>hellohere</dc:creator>
    <dc:date>2026-01-30T08:05:04Z</dc:date>
    <item>
      <title>SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982647#M379361</link>
      <description>&lt;P&gt;I have a dataset[attached below], and get a plot of a bunch of lines[below]. The code used does&lt;/P&gt;
&lt;P&gt;specify the line color/thinkness. How to do so?!&lt;/P&gt;
&lt;P&gt;Say line color in seq [RED, BLUE, CYAN, BLACK, RED, BLUE, CYAN, BLACK]&lt;/P&gt;
&lt;P&gt;Line thickness, [1,1,1, 3,3 , 2,2,2]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;			proc sgplot data=_t_mm_temp_coll_n_t(where=(xahead in (-20,-10,0, 5, 10,20,30,40)));
							by tvar;
							series x=ncut y= cttot/ group =xahead ;  
							yaxis max=500 min=450;
							refline  490/axis=y lineattrs=(color=red thickness=2 pattern=solid); 
							refline  480/axis=y lineattrs=(color=cyan thickness=1 pattern=solid); 
						run;quit;&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="sgplot.jpg" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/112871iEB3D0F867B3A3054/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot.jpg" alt="sgplot.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 13:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982647#M379361</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2026-01-29T13:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982648#M379362</link>
      <description>&lt;P&gt;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;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you can use discrete attribute maps&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n03orofvtqwhhon1kkn76l1ovjkx.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n03orofvtqwhhon1kkn76l1ovjkx.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are concerned about getting colors and lines the way you want, then also to improve the look of your plot I suggest you use proper ENGLISH words and descriptions (or whatever language you speak normally) in titles and labels and legends, instead of computerese gibberish such as tvar=volcsum_t&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 14:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982648#M379362</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-01-29T14:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982702#M379372</link>
      <description>&lt;P&gt;styleattrs datacontrastcolors=(lime red purple skyblue) ;&amp;nbsp; Works. But does not take linepatterns[or thinkness] anymore.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The title, I will leave alone. It is generated with macro. TVar stands for Target Variable. If spell out, need many lines since of invocations with variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;85               proc sgplot data=_t_mm_temp_coll_n_t(where=(xahead in (0, 5, 10,20)));
86                               by tvar;
87                               styleattrs datacontrastcolors=(lime red purple skyblue) ;
88                               styleattrs DATALINEPATTERNS=(1 2 4 15);
89                               series x=ncut y= cttot/ group =xahead ;
90                               yaxis max=500 min=450;
91                               refline  490/axis=y lineattrs=(color=red thickness=2
91 ! pattern=solid);
92                               refline  480/axis=y lineattrs=(color=cyan thickness=1
92 ! pattern=solid);
93                           run;

93 !                             quit;
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.37 seconds
      cpu time            0.06 seconds

NOTE: This graph has ATTRPRIORITY=COLOR in effect. The cycling of your custom symbols and/or line
      patterns is based on color priority. Please see ODS Graphics documentation on ATTRPRIORITY=
      option.
NOTE: This graph has ATTRPRIORITY=COLOR in effect. The cycling of your custom symbols and/or line
      patterns is based on color priority. Please see ODS Graphics documentation on ATTRPRIORITY=
      option.
NOTE: There were 64 observations read from the data set WORK._T_MM_TEMP_COLL_N_T.
      WHERE xahead in (0, 5, 10, 20);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jan 2026 08:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982702#M379372</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2026-01-30T08:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982708#M379374</link>
      <description>&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dattrmap;
input id $ value :$20. linecolor $ linethickness;
cards;
id IBM        red     2
id Intel      green   4
id Microsoft  blue    8
;

proc sgplot data=sashelp.stocks dattrmap=dattrmap;
series x=date y=close /group=stock attrid=id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1769761144744.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/112893iA753003E39B28B3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1769761144744.png" alt="Ksharp_0-1769761144744.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 08:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982708#M379374</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-01-30T08:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982710#M379375</link>
      <description>&lt;P&gt;Thanks, this works out perfectly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also can add " DATALINEPATTERNS"?!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 08:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982710#M379375</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2026-01-30T08:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982711#M379376</link>
      <description>Yes. I think so. Check SAS Doc.</description>
      <pubDate>Fri, 30 Jan 2026 08:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982711#M379376</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-01-30T08:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982713#M379377</link>
      <description>&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dattrmap;
input id $ value :$20. linecolor $ linethickness linepattern :$20.;
cards;
id IBM        red     2  dot
id Intel      green   4  dash
id Microsoft  blue    8  solid
;

proc sgplot data=sashelp.stocks dattrmap=dattrmap;
series x=date y=close /group=stock attrid=id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1769762692449.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/112894iD251E5A6C9FCCD7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1769762692449.png" alt="Ksharp_0-1769762692449.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 08:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982713#M379377</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-01-30T08:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT how to specify line color/thickness for a bunch of lines?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982719#M379378</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409584"&gt;@hellohere&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;styleattrs datacontrastcolors=(lime red purple skyblue) ;&amp;nbsp; Works. But does not take linepatterns[or thinkness] anymore.&amp;nbsp;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's why I also provided example of using a discrete attribute map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409584"&gt;@hellohere&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The title, I will leave alone. It is generated with macro. TVar stands for Target Variable. If spell out, need many lines since of invocations with variables.&amp;nbsp;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In my opinion, poor choice. No one wants to see or know what your computer code looks like. They want to understand the plot. And my suggestion applies to all text on the plot, not just the title.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 11:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-how-to-specify-line-color-thickness-for-a-bunch-of-lines/m-p/982719#M379378</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-01-30T11:51:03Z</dc:date>
    </item>
  </channel>
</rss>

