<?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: how to add line colors in proc sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710025#M20858</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;Several things i want to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. how to remove yaxis label ("count") without removing yaxis grid?&amp;nbsp; I tried YAXIS DISPLAY=(NOLABEL) but it removed both label and grid lines&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; How to add colors on line graph on .rtf file (example shown below)&lt;/P&gt;
&lt;P&gt;3. How to have y-axis start at "0" instead of "210"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;4. how to expand graph bigger so that it can fit the page better&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_0-1610047109185.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53282i1F715A27243D9EEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_0-1610047109185.png" alt="HitmonTran_0-1610047109185.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
Proc sgplot data=work.toplot noautolegend;
   where enrlfl='Y';
   reg x=enrldt y=count / lineattrs=(pattern=shortdash);
   series x=enrldt  y=count;
   yaxis grid;
   XAXIS DISPLAY=(NOLABEL);
 run;   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;current output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_2-1610047272297.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53284iBB5A2526699FD89E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_2-1610047272297.png" alt="HitmonTran_2-1610047272297.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1. how to remove yaxis label ("count") without removing yaxis grid?&amp;nbsp; I tried YAXIS DISPLAY=(NOLABEL) but it removed both label and grid lines:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add Label = " " to the yaxis.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; How to add colors on line graph on .rtf file (example shown below): Color which lines? What color?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; you can specify a color for the graphed line by adding to the lineattrs=(pattern=shortdash color=Blue)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The default colors are set based on the currently active ODS Style&lt;/P&gt;
&lt;P&gt;3. How to have y-axis start at "0" instead of "210"? Specify values.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add to the Yaxis statement. something like Values=(0 to 250 by 50) which places a tick mark at 0, 50, 100, ... 250 ( I prefer positive control when possible) or the option MIN=0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;4. how to expand graph bigger so that it can fit the page better&amp;nbsp;&amp;nbsp; The size of the graph is set using the ODS Graphics options. Such as ODS Graphics / height=5in width=5in ; would set the display area to 5x5 inches. You can use other units of measure like CM, MM, pct (percentage). Note that changing both height and width can result in an aspect change and distort fonts and by default larger area will use larger font sizes. There are about 20 options. I'm not going to go through the list. Look up "ods graphics" statement in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 19:55:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-07T19:55:53Z</dc:date>
    <item>
      <title>how to add line colors in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710003#M20857</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Several things i want to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. how to remove yaxis label ("count") without removing yaxis grid?&amp;nbsp; I tried YAXIS DISPLAY=(NOLABEL) but it removed both label and grid lines&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; How to add colors on line graph on .rtf file (example shown below)&lt;/P&gt;&lt;P&gt;3. How to have y-axis start at "0" instead of "210"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;4. how to expand graph bigger so that it can fit the page better&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;want:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_0-1610047109185.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53282i1F715A27243D9EEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_0-1610047109185.png" alt="HitmonTran_0-1610047109185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
Proc sgplot data=work.toplot noautolegend;
   where enrlfl='Y';
   reg x=enrldt y=count / lineattrs=(pattern=shortdash);
   series x=enrldt  y=count;
   yaxis grid;
   XAXIS DISPLAY=(NOLABEL);
 run;   &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;current output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_2-1610047272297.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53284iBB5A2526699FD89E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_2-1610047272297.png" alt="HitmonTran_2-1610047272297.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 19:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710003#M20857</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2021-01-07T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to add line colors in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710025#M20858</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;Several things i want to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. how to remove yaxis label ("count") without removing yaxis grid?&amp;nbsp; I tried YAXIS DISPLAY=(NOLABEL) but it removed both label and grid lines&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; How to add colors on line graph on .rtf file (example shown below)&lt;/P&gt;
&lt;P&gt;3. How to have y-axis start at "0" instead of "210"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;4. how to expand graph bigger so that it can fit the page better&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_0-1610047109185.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53282i1F715A27243D9EEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_0-1610047109185.png" alt="HitmonTran_0-1610047109185.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
Proc sgplot data=work.toplot noautolegend;
   where enrlfl='Y';
   reg x=enrldt y=count / lineattrs=(pattern=shortdash);
   series x=enrldt  y=count;
   yaxis grid;
   XAXIS DISPLAY=(NOLABEL);
 run;   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;current output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_2-1610047272297.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53284iBB5A2526699FD89E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_2-1610047272297.png" alt="HitmonTran_2-1610047272297.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1. how to remove yaxis label ("count") without removing yaxis grid?&amp;nbsp; I tried YAXIS DISPLAY=(NOLABEL) but it removed both label and grid lines:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add Label = " " to the yaxis.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; How to add colors on line graph on .rtf file (example shown below): Color which lines? What color?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; you can specify a color for the graphed line by adding to the lineattrs=(pattern=shortdash color=Blue)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The default colors are set based on the currently active ODS Style&lt;/P&gt;
&lt;P&gt;3. How to have y-axis start at "0" instead of "210"? Specify values.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add to the Yaxis statement. something like Values=(0 to 250 by 50) which places a tick mark at 0, 50, 100, ... 250 ( I prefer positive control when possible) or the option MIN=0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;4. how to expand graph bigger so that it can fit the page better&amp;nbsp;&amp;nbsp; The size of the graph is set using the ODS Graphics options. Such as ODS Graphics / height=5in width=5in ; would set the display area to 5x5 inches. You can use other units of measure like CM, MM, pct (percentage). Note that changing both height and width can result in an aspect change and distort fonts and by default larger area will use larger font sizes. There are about 20 options. I'm not going to go through the list. Look up "ods graphics" statement in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 19:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710025#M20858</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-07T19:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to add line colors in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710038#M20859</link>
      <description>&lt;P&gt;sorry i am fairly new to SAS,&lt;/P&gt;&lt;P&gt;when i add label='&amp;nbsp; '&amp;nbsp; on yaxis statement, it removes the grid lines.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc sgplot data=work.toplot noautolegend;
where enrlfl='Y';
reg x=enrldt y=count / lineattrs=(pattern=shortdash);
series x=enrldt y=count / lineattrs=(color=teal);
yaxis grid label='';
XAXIS DISPLAY=(NOLABEL);
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 20:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710038#M20859</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2021-01-07T20:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to add line colors in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710052#M20860</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;sorry i am fairly new to SAS,&lt;/P&gt;
&lt;P&gt;when i add label='&amp;nbsp; '&amp;nbsp; on yaxis statement, it removes the grid lines.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc sgplot data=work.toplot noautolegend;
where enrlfl='Y';
reg x=enrldt y=count / lineattrs=(pattern=shortdash);
series x=enrldt y=count / lineattrs=(color=teal);
yaxis grid label='';
XAXIS DISPLAY=(NOLABEL);
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;May be a version difference. On my system the grid lines stay.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 21:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710052#M20860</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-07T21:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to add line colors in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710666#M20867</link>
      <description>&lt;P&gt;It'll be easier for us to communicate if we use the same data. Here is some code that creates a graph for some data that are distributed with SAS. Paste the graph that results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc sgplot data=sashelp.air noautolegend;
reg x=Date y=Air / lineattrs=(pattern=shortdash);
series x=Date y=Air / lineattrs=(color=teal);
yaxis grid display=(nolabel);
xaxis display=(nolabel);
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To address the "what version do have" question, run this command&lt;BR /&gt;%put &amp;amp;=SYSVLONG4;&lt;/P&gt;
&lt;P&gt;and paste the results from the log. It will look something like this:&lt;/P&gt;
&lt;P&gt;SYSVLONG4=9.04.01M6P11072018&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 19:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-add-line-colors-in-proc-sgplot/m-p/710666#M20867</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-01-11T19:09:21Z</dc:date>
    </item>
  </channel>
</rss>

