<?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: Plotting with a Special X variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94371#M3519</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a line graph and all the values in the week column should be in the x axis of the graph not just the year 97..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have posted this question before and had difficulties when I tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Dec 2012 19:39:35 GMT</pubDate>
    <dc:creator>malakaext</dc:creator>
    <dc:date>2012-12-08T19:39:35Z</dc:date>
    <item>
      <title>Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94367#M3515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one please let me know how to plot Var(y variable) in the attached data set Vs. Week ( X variable)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Note that 1997-1 refers to the 1st week of 1997, 1997- 40 refers to the 40th week of 1997.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of this special format of the x variable a normal sas code cannot be youed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 18:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94367#M3515</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-12-08T18:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94368#M3516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the definition of week 1 in a given year? The first week containing a given weekday, the first complete week, the first week containing at least 4 days? - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 19:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94368#M3516</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-12-08T19:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94369#M3517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually I had the attached data set. I calculated the weekly variances using excel. I got the week number from the date using WEEKNUM in excel.&lt;/P&gt;&lt;P&gt;So, weeks like 1st week did not have all five days in the weekly variance calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 19:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94369#M3517</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-12-08T19:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94370#M3518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; What kind of plot do you want? Scatter plot, line plot, dot plot, series plot? What code have you tried? SAS/GRAPH and PROC GPLOT or ODS GRAPHICS and PROC SGPLOT? Can you show the code that you have tried?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; Is your WEEK variable character or numeric? You have data that represents a lot of years, do you want every YEAR to be a separate scatter symbol or a separate LINE color? If so, you will need to have a YEAR variable in your data.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; Is this question related to this other question? &lt;A _jive_internal="true" href="https://communities.sas.com/thread/39336"&gt;https://communities.sas.com/thread/39336&lt;/A&gt; You had some suggestions in that posting, that may help you with this question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For example, in the image created in code #1, only 20-21 values for X are shown for 1 year. With more than 1 year or more weeks on image #1, the X axis would become unreadable. On the other hand, with code example #2, since a separate YEAR variable is used as a GROUP= variable, then you can make multiple plot lines, one for each year. (If you changed to BY year (code #3) or used SGPANEL (code #4), you would get different output.)&lt;BR /&gt; &lt;BR /&gt;cynthia&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data dateval;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; infile datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; input week $ var;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; year = input(scan(week,1,'-'),4.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; weeknum = input(scan(week,2,'-'),2.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;return;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-1 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-2 0.003142039&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-3 0.011184462&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-4 0.003932907&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-5 0.004176446&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-6 0.003766596&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-7 0.002643895&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-8 0.00960544&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-9 0.001378906&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-10 0.001248404&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-11 0.000216714&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-12 0.000714136&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-13 0.000786933&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-14 0.001784908&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-15 0.000475066&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-16 7.03E-05&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-17 0.001656748&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-18 0.000707953&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-19 0.000308805&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-20 0.000579109&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1997-21 0.000353416&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-1 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-2 0.001424841&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-3 0.000622539&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-4 0.000155405&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-5 0.000239838&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-6 0.000744065&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-7 0.000467641&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-8 0.000132295&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-9 0.000348177&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-10 0.000383507&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-11 0.00042303&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-12 0.00010362&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-13 0.000473917&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-14 0.000566873&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-15 0.00090204&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-16 0.000530124&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-17 0.000418762&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-18 0.000514736&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-19 0.001233775&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-20 0.000619137&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1998-21 0.000462966&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html path='c:\temp' (url=none) file='diff_examp.html';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=dateval;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;where scan(week,1,'-') = '1997';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title '1) Using 1 var for X and no group';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title2 'for partial weeks in 1997';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;series x=week y=var;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;xaxis fitpolicy=staggerthin;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=dateval;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title '2) Using Separate Numeric Variables for X and GROUP var';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;series x=weeknum y=var/group=year;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;xaxis values=(0 to 21 by 1) fitpolicy=stagger;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sort data=dateval;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; by year weeknum;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=dateval;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title '3) Using BY group processing';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;by year;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;series x=weeknum y=var;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;xaxis values=(0 to 21 by 1) fitpolicy=stagger;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgpanel data=dateval;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title '4) Using SGPANEL and PANELBY';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;panelby year;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;series x=weeknum y=var;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;colaxis values=(0 to 21 by 1) fitpolicy=thin;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 19:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94370#M3518</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-12-08T19:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94371#M3519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a line graph and all the values in the week column should be in the x axis of the graph not just the year 97..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have posted this question before and had difficulties when I tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 19:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94371#M3519</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-12-08T19:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94372#M3520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Did you try any of the code that's been posted? And, if so, what error messages did you get?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If you run the code below on the dataset that I created in my original response to your post, you will get output, as shown in the screenshot. Eventually, with ALL years and ALL weeks, the X axis will become unreadable. This image is for 21 weeks in 97 and 21 weeks in 98 and the X axis is already crowded ... much more data and you couldn't even read the X axis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When you try to present data with so many data points on the X axis -- and I have only 42 for 2 years -- by my calculation, you will have 9 years of data (from your CSV file) for 1997-2005, with at least 52 weeks per year, which will make at least 9*52=468+ (probably more since some years have 53 weeks) tick marks on the X axis. That is simply too many data points to be meaningful. In my opinion, you may need to rethink your method of presenting this data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html path='c:\temp' (url=none) file='x_axis_alt.html';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=dateval;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title '5) Using all data for X';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title2 'X axis will become unreadable';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; series x=week y=var;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sgplot data=dateval;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title '6) Using REFLINE';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title2 'suppress all the ticks and use REFLINE';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; series x=week y=var;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1997-1' / axis=x label='1997';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1997-5' / axis=x label='Wk5';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1997-10' / axis=x label= 'Wk10';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1997-15' / axis=x label= 'Wk15';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1998-1' / axis=x label='1998';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1998-5' / axis=x label='Wk5';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1998-10' / axis=x label= 'Wk10';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; refline '1998-15' / axis=x label= 'Wk15';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; xaxis display=none;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10699iB5FA1743BF5381C3/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="x_axis_prob.png" title="x_axis_prob.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 20:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94372#M3520</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-12-08T20:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94373#M3521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It can be quite hard to emulate function WEEKNUM from EXCEL with SAS formats. But it might not be very useful to do so anyway. The following represents the dates appropriately as the Wednesday of the week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data wtest(keep=wDate Var);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;infile "&amp;amp;sasforum.\datasets\wtest.csv" dsd firstobs=2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;input txtdate $ Var;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;year = input(scan(txtdate,1),4.0);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;week = input(scan(txtdate,2),2.0);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;wDate = intnx("WEEK.4", mdy(1,1,year), week-1);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;format wDate date9.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc sgplot data=wTest;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;series y=var x=wDate;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;xaxis type=time label="Date";&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 21:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94373#M3521</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-12-08T21:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94374#M3522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cynthia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used your code I get the following errors. I am using SAS 9.0. Is it be cause of that. yes, I understand what you say about the x axis becoming unreadable. So, I am planning to present it for each year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you ALL for your valuable time and inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;870&lt;/P&gt;&lt;P&gt;871&lt;/P&gt;&lt;P&gt;872&lt;/P&gt;&lt;P&gt;873&amp;nbsp; ods html path="F:\data\test.csv" (url=none) file='diff_examp.html';&lt;/P&gt;&lt;P&gt;NOTE: Writing HTML Body file: diff_examp.html&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR: Physical file does not exist, F:\data\test.csv\diff_examp.html.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;WARNING: No body file.&amp;nbsp; HTML output will not be created.&lt;/P&gt;&lt;P&gt;874&lt;/P&gt;&lt;P&gt;875&amp;nbsp; proc sgplot data=dateval;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Procedure SGPLOT not found.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;876&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 23:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94374#M3522</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-12-08T23:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94375#M3523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Well, you have 2 problems. #1 applies for both SAS/GRAPH and ODS GRAPHICS; but #2 is based on your SAS version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) PATH= is pointing to a .CSV file and it should point to a high-level directory. PATH= is supposed to indicate the folder where your output (graph and HTML file) will be stored. So you probably want:&lt;/P&gt;&lt;P&gt;ods html path="F:\data" (url=none) file='diff_examp.html';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made some FAKE data in my program. I called the FAKE data file WORK.DATEVAL -- if you are testing my program, then you would need to run my program to make WORK.DATEVAL before you run my code. Or, alternately, if you want to try my program on your data, then you will need to use one of the other examples to read YOUR CSV file into a SAS dataset and then change the name in the DATA= option accordingly. But, no matter what you do PATH= is meant to be a FOLDER directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Your biggest challenge is that if you are using SAS 9.0, then SGPLOT was not production or available until SAS 9.2. When and if you do get the ODS invocation working, you will probably get an error message using PROC &lt;STRONG&gt;SG&lt;/STRONG&gt;PLOT. So you would have to use SAS/GRAPH and PROC &lt;STRONG&gt;G&lt;/STRONG&gt;PLOT, instead. I believe that someone has already posted some examples of PROC GPLOT for you in a different post based on this same question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Dec 2012 00:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94375#M3523</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-12-09T00:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94376#M3524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cynthian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much. That's a really nice explanation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Dec 2012 00:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94376#M3524</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-12-09T00:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting with a Special X variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94377#M3525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's another technique that assigns a sequential numeric variable (x_num) to all the x-values, and then plots by that value (to keep the x-axis in the proper order) - I generate a user-defined-format from the data (xfmt.) and I apply that user-defined format so that the x-values "print" on the graph with the character date value.&amp;nbsp; I use "xpixels=6000" to make the plot *really* wide, so the 477 x-values are spread out enough that they don't overlap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wtest;&lt;/P&gt;&lt;P&gt;infile "Wtest.csv" dsd firstobs=2;&lt;/P&gt;&lt;P&gt;input txtdate $ Var;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wtest; set wtest;&lt;/P&gt;&lt;P&gt;x_num=_n_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table foo as&lt;/P&gt;&lt;P&gt;select unique x_num as start, txtdate as label&lt;/P&gt;&lt;P&gt;from wtest;&lt;/P&gt;&lt;P&gt;quit; run;&lt;/P&gt;&lt;P&gt;data control; set foo;&lt;/P&gt;&lt;P&gt;fmtname = 'xfmt';&lt;/P&gt;&lt;P&gt;type = 'N';&lt;/P&gt;&lt;P&gt;end = START;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc format lib=work cntlin=control;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis1 order=(0 to .2 by .025) minor=none;&lt;/P&gt;&lt;P&gt;axis2 order=(0 to 477 by 1) value=(angle=90);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbol1 value=dot interpol=join;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions xpixels=6000 ypixels=500;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gplot data=wtest;&lt;/P&gt;&lt;P&gt;format x_num xfmt.;&lt;/P&gt;&lt;P&gt;plot var*x_num=1 / vaxis=axis1 haxis=axis2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 13:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-with-a-Special-X-variable/m-p/94377#M3525</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2012-12-10T13:38:42Z</dc:date>
    </item>
  </channel>
</rss>

