<?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 Why Does SGPLOT Trim Some Observations Automatically? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606244#M19142</link>
    <description>&lt;P&gt;When I apply VALUES and VALUESFORMAT in XAXIS, SGPLOT automatically trims some trailing observations. The left uses a naked format so displays correctly, but the right uses YEAR10 in VALUES and YEAR4. in VALUESFORMAT so ends much earlier than the left. How can I avoid this problem?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="out.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34140i49711ACFEB9E3D25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="out.png" alt="out.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="out1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34141i2B20C2E4FED67C8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="out1.png" alt="out1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's the code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
t=mdy(1,1,1900);
do until(year(t)&amp;gt;2018);
x+rannor(1);
output;
t=intnx("month",t,1);
end;
run;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset imagename="out";
proc sgplot;
series x=t y=x;
run;
proc sgplot;
series x=t y=x;
xaxis values=("1jan1900"d to "1jan2019"d by year10) valuesformat=year4.;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 18:16:25 GMT</pubDate>
    <dc:creator>Junyong</dc:creator>
    <dc:date>2019-11-21T18:16:25Z</dc:date>
    <item>
      <title>Why Does SGPLOT Trim Some Observations Automatically?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606244#M19142</link>
      <description>&lt;P&gt;When I apply VALUES and VALUESFORMAT in XAXIS, SGPLOT automatically trims some trailing observations. The left uses a naked format so displays correctly, but the right uses YEAR10 in VALUES and YEAR4. in VALUESFORMAT so ends much earlier than the left. How can I avoid this problem?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="out.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34140i49711ACFEB9E3D25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="out.png" alt="out.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="out1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34141i2B20C2E4FED67C8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="out1.png" alt="out1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's the code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
t=mdy(1,1,1900);
do until(year(t)&amp;gt;2018);
x+rannor(1);
output;
t=intnx("month",t,1);
end;
run;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset imagename="out";
proc sgplot;
series x=t y=x;
run;
proc sgplot;
series x=t y=x;
xaxis values=("1jan1900"d to "1jan2019"d by year10) valuesformat=year4.;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 18:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606244#M19142</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2019-11-21T18:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does SGPLOT Trim Some Observations Automatically?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606251#M19143</link>
      <description>&lt;P&gt;Your interval is uneven, what happens if it ends at 2020, not 2019 as indicated in your specification?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;xaxis values=("1jan1900"d to &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;"1jan2019"d&lt;/STRONG&gt;&lt;/FONT&gt; by &lt;FONT size="5"&gt;&lt;STRONG&gt;year10&lt;/STRONG&gt;&lt;/FONT&gt;) valuesformat=year4.;&lt;/PRE&gt;
&lt;P&gt;My guess is because it's not a full interval it cuts off at the last 10 interval, instead of going past as the default behaviour.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=p07m2vpyq75fgan14m6g5pphnwlr.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n09f4ln7jq8gkan1w2nhlkzjcrqza" target="_self"&gt;From the documentation:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class="xisDoc-paraSimple"&gt;If the specified range is not evenly divisible by the increment value, &lt;FONT color="#800080"&gt;&lt;STRONG&gt;the highest value displayed on the axis is the last incremental value below the ending value for the range&lt;/STRONG&gt;&lt;/FONT&gt;. For example, this value list produces a maximum axis value of 9:&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;LI-CODE lang="sas"&gt;values&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;to&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;by&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173881"&gt;@Junyong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I apply VALUES and VALUESFORMAT in XAXIS, SGPLOT automatically trims some trailing observations. The left uses a naked format so displays correctly, but the right uses YEAR10 in VALUES and YEAR4. in VALUESFORMAT so ends much earlier than the left. How can I avoid this problem?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="out.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34140i49711ACFEB9E3D25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="out.png" alt="out.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="out1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34141i2B20C2E4FED67C8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="out1.png" alt="out1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here's the code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
t=mdy(1,1,1900);
do until(year(t)&amp;gt;2018);
x+rannor(1);
output;
t=intnx("month",t,1);
end;
run;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset imagename="out";
proc sgplot;
series x=t y=x;
run;
proc sgplot;
series x=t y=x;
xaxis values=("1jan1900"d to "1jan2019"d by year10) valuesformat=year4.;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 18:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606251#M19143</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-21T18:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does SGPLOT Trim Some Observations Automatically?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606253#M19144</link>
      <description>&lt;P&gt;Try adding the VALUESHINT option to the XAXIS. This should make the VALUES option place the ticks correctly without constraining the axis range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 18:56:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606253#M19144</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-11-21T18:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why Does SGPLOT Trim Some Observations Automatically?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606304#M19145</link>
      <description>&lt;P&gt;Any values list will "trim the data" if the limits are less than the range of the values.&lt;/P&gt;
&lt;P&gt;It is actually a useful feature as you can quickly modify the amount of data displayed as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Such as&lt;/P&gt;
&lt;PRE&gt;proc sgplot;
series x=t y=x;
xaxis values=(-1750 -600 0 380 1800);
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 21:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Why-Does-SGPLOT-Trim-Some-Observations-Automatically/m-p/606304#M19145</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-21T21:50:03Z</dc:date>
    </item>
  </channel>
</rss>

