<?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: picture format for time axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935254#M24766</link>
    <description>&lt;P&gt;Mmm things seem odd indeed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I conducted a few more tests, and the picture format seems to be misinterpreted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
    picture monyyd (default=6) low - high = '%b-%y' (datatype=date);
run;

ods graphics on / width=5cm height=3cm;&lt;BR /&gt;
data CLASS;
    set SASHELP.CLASS;
    if SEX='M' then MONTH='01MAR2024'd;
    else MONTH='01APR2024'd;
    MONTHC=put(MONTH,monyyd.);
run;

proc sgplot data=CLASS;
   vbarbasic MONTHC / response=HEIGHT stat=mean; 
run;
 
title 'format monyy.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;  
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month;
   format MONTH monyy.;
run;
title 'valuesformat monyy.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;  
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyy.;
run;
title 'format valuesformat monyy.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;  
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyy.;
   format MONTH monyy.;
run;

title 'format monyyd.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month;
   format MONTH monyyd.;
run;   

title 'valuesformat monyyd.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean; 
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyyd.;
run;    

title 'format valuesformat monyyd.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyyd.;
   format MONTH monyyd.;
run;   
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also tried with datetime values as the confusing&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;NOTE: Time axis can only support date time values. The axis type will be changed to LINEAR.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;message implies, to no avail.&lt;/P&gt;
&lt;P&gt;Another confusing message is&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;NOTE: Since no format is assigned, the numeric category variable will use the default of BEST6.
&lt;/CODE&gt;that appears even though a format is defined.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisNZ_0-1720579189600.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98268iD9FF8606A1AF707D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisNZ_0-1720579189600.png" alt="ChrisNZ_0-1720579189600.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 02:39:55 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2024-07-10T02:39:55Z</dc:date>
    <item>
      <title>picture format for time axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935221#M24764</link>
      <description>&lt;P&gt;Is it possible to use a picture format for the values a time axis?&lt;/P&gt;
&lt;P&gt;In my test, it does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
    picture monyyd (default=6) low - high = '%b-%y' (datatype=date);
run;


data class;
    set sashelp.class;
    if sex='M' then month='01MAR2024'd;
    else month='01APR2024'd;
    monthc=put(month,monyyd.);
run;

proc sgplot data=class;
   vbarbasic monthc / response=height stat=mean; 
run; 

proc sgplot data=class;
   vbarbasic month / response=height stat=mean;
  
   xaxis values=('01MAR2024'd to '01APR2024'd by month) 
         type=time 
         interval=month
         valuesformat=monyy5.;
run;


proc sgplot data=class;
   vbarbasic month / response=height stat=mean;
  
   xaxis values=('01MAR2024'd to '01APR2024'd by month) 
         type=time 
         interval=month
         valuesformat=monyyd.;
run;      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 19:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935221#M24764</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2024-07-09T19:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: picture format for time axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935254#M24766</link>
      <description>&lt;P&gt;Mmm things seem odd indeed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I conducted a few more tests, and the picture format seems to be misinterpreted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
    picture monyyd (default=6) low - high = '%b-%y' (datatype=date);
run;

ods graphics on / width=5cm height=3cm;&lt;BR /&gt;
data CLASS;
    set SASHELP.CLASS;
    if SEX='M' then MONTH='01MAR2024'd;
    else MONTH='01APR2024'd;
    MONTHC=put(MONTH,monyyd.);
run;

proc sgplot data=CLASS;
   vbarbasic MONTHC / response=HEIGHT stat=mean; 
run;
 
title 'format monyy.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;  
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month;
   format MONTH monyy.;
run;
title 'valuesformat monyy.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;  
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyy.;
run;
title 'format valuesformat monyy.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;  
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyy.;
   format MONTH monyy.;
run;

title 'format monyyd.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month;
   format MONTH monyyd.;
run;   

title 'valuesformat monyyd.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean; 
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyyd.;
run;    

title 'format valuesformat monyyd.'; 
proc sgplot data=CLASS;
   vbarbasic MONTH / response=HEIGHT stat=mean;
   xaxis values  = ('01MAR2024'd to '01APR2024'd by month) 
         type    = time 
         interval= month
         valuesformat=monyyd.;
   format MONTH monyyd.;
run;   
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also tried with datetime values as the confusing&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;NOTE: Time axis can only support date time values. The axis type will be changed to LINEAR.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;message implies, to no avail.&lt;/P&gt;
&lt;P&gt;Another confusing message is&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;NOTE: Since no format is assigned, the numeric category variable will use the default of BEST6.
&lt;/CODE&gt;that appears even though a format is defined.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisNZ_0-1720579189600.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98268iD9FF8606A1AF707D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisNZ_0-1720579189600.png" alt="ChrisNZ_0-1720579189600.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 02:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935254#M24766</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-07-10T02:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: picture format for time axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935536#M24768</link>
      <description>&lt;P&gt;I'd contact tech support if no one answers here. This is strange.&lt;/P&gt;
&lt;P&gt;Please keep this post updated if you do. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 02:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935536#M24768</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-07-12T02:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: picture format for time axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935546#M24769</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1720763912892.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98331iDB78603D68DE22A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1720763912892.png" alt="Ksharp_0-1720763912892.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 05:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935546#M24769</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-12T05:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: picture format for time axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935553#M24770</link>
      <description>That's a crazy shortcoming of ODS graphics. Even some SAS formats are unsupported after all these years it's been around! How did the developers get away with that? &lt;BR /&gt;&lt;BR /&gt;Here's the link &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p0mwk2su1mw8bnn1f6xonfde64h5.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p0mwk2su1mw8bnn1f6xonfde64h5.htm&lt;/A&gt;</description>
      <pubDate>Fri, 12 Jul 2024 08:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935553#M24770</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-07-12T08:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: picture format for time axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935565#M24771</link>
      <description>&lt;P&gt;You can try this "workaround":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
    picture monyyd (default=6) low - high = '%b-%y' (datatype=date);
run;

data class;
    set sashelp.class;
    if sex='M' then month='01MAR2024'd;
    else month='01APR2024'd;
    monthc=put(month,monyyd.);
run;


%macro looper(d,n,f=best12.);
%do i = 0 %to &amp;amp;n.-1;
"%Sysfunc(intnx(month,&amp;amp;d.,&amp;amp;i.),&amp;amp;f.)"
%end;
%mend looper;

proc sgplot data=class;
   vbarbasic month / response=height stat=mean;
   xaxis 
    values=(%looper('01MAR2024'd,2))
    VALUESDISPLAY=(%looper('01MAR2024'd,2,f=monyyd.)) 
    ;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 11:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/picture-format-for-time-axis/m-p/935565#M24771</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-07-12T11:30:04Z</dc:date>
    </item>
  </channel>
</rss>

