<?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: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275008#M9823</link>
    <description>&lt;P&gt;Does this code not work if you move to proc sgplot? &amp;nbsp;I changed the code to proc sgplot and now this format doesn't work anymore.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2016 16:07:40 GMT</pubDate>
    <dc:creator>einstein</dc:creator>
    <dc:date>2016-06-03T16:07:40Z</dc:date>
    <item>
      <title>Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272475#M9718</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a line graph with multiple lines for each product by year and quarter. &amp;nbsp;To display the year and quarter together, I simply concatenated the two variables and created a new year_qtr variable. &amp;nbsp;However, as you can see in the attached graph, it looks awfully crowded. &amp;nbsp;Is there a way to simply show the year once for the four quarters, as opposed to for each quarter? &amp;nbsp;And I'd still like to show the quarterly data points, so simply using the year variable doesn't help with that. &amp;nbsp;Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code as generated by SAS below, but truncated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%_eg_conditional_dropds(WORK.SORTTempTableSorted);&lt;BR /&gt;SYMBOL1&lt;BR /&gt;INTERPOL=JOIN&lt;BR /&gt;HEIGHT=10pt&lt;BR /&gt;VALUE=NONE&lt;BR /&gt;LINE=1&lt;BR /&gt;WIDTH=2&lt;/P&gt;&lt;P&gt;CV = _STYLE_&lt;BR /&gt;;&lt;BR /&gt;SYMBOL2&lt;BR /&gt;INTERPOL=JOIN&lt;BR /&gt;HEIGHT=10pt&lt;BR /&gt;VALUE=NONE&lt;BR /&gt;LINE=1&lt;BR /&gt;WIDTH=2&lt;/P&gt;&lt;P&gt;CV = _STYLE_&lt;BR /&gt;;&lt;BR /&gt;SYMBOL3&lt;BR /&gt;INTERPOL=JOIN&lt;BR /&gt;HEIGHT=10pt&lt;BR /&gt;VALUE=NONE&lt;BR /&gt;LINE=1&lt;BR /&gt;WIDTH=2&lt;/P&gt;&lt;P&gt;CV = _STYLE_&lt;BR /&gt;;&lt;BR /&gt;Legend1&lt;BR /&gt;FRAME&lt;BR /&gt;;&lt;BR /&gt;Axis1&lt;BR /&gt;STYLE=1&lt;BR /&gt;WIDTH=1&lt;BR /&gt;MINOR=NONE&lt;BR /&gt;label=('Number of Prescriptions');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Axis2&lt;BR /&gt;STYLE=1&lt;BR /&gt;WIDTH=1&lt;BR /&gt;MINOR=NONE&lt;BR /&gt;label=('Year, Quarter');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TITLE;&lt;BR /&gt;TITLE1 "Number of Prescriptions by Year/Quarter";&lt;BR /&gt;FOOTNOTE;&lt;BR /&gt;FOOTNOTE1 "Source: XXX Data, 2005-2015";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE VIEW WORK.SORTTempTableSorted AS&lt;BR /&gt;SELECT statecd, hcv_rc ,year_qtr,&lt;BR /&gt;SUM(num_presc) AS num_presc_SUM&lt;BR /&gt;FROM HCV.HCVX&lt;/P&gt;&lt;P&gt;GROUP BY statecd,hcv_rc,year_qtr&lt;BR /&gt;ORDER BY statecd,hcv_rc,year_qtr&lt;BR /&gt;;&lt;BR /&gt;QUIT;&lt;BR /&gt;Legend1 label=(color=black height=1 'HCV Drugs') cborder=black;&lt;BR /&gt;PROC GPLOT DATA = WORK.SORTTempTableSorted;&amp;nbsp;&lt;BR /&gt;PLOT num_presc_SUM * year_qtr =hcv_rc&lt;BR /&gt;/&lt;BR /&gt;VAXIS=AXIS1&lt;/P&gt;&lt;P&gt;HAXIS=AXIS2&lt;BR /&gt;&lt;BR /&gt;FRAME LEGEND=LEGEND1&lt;BR /&gt;;BY statecd;&lt;BR /&gt;&lt;BR /&gt;RUN; QUIT;&lt;BR /&gt;%_eg_conditional_dropds(WORK.SORTTempTableSorted);&lt;BR /&gt;TITLE; FOOTNOTE;&lt;BR /&gt;GOPTIONS RESET = SYMBOL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12569i8ADF1F6BCBCB6E8F/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SAS Graph.PNG" title="SAS Graph.PNG" /&gt;</description>
      <pubDate>Mon, 23 May 2016 17:20:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272475#M9718</guid>
      <dc:creator>einstein</dc:creator>
      <dc:date>2016-05-23T17:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272506#M9722</link>
      <description>&lt;P&gt;One way would be to create a custom format that only dislayed the year for the first quarter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;/P&gt;
&lt;P&gt;value $Myyrqtr&lt;/P&gt;
&lt;P&gt;'2011&amp;nbsp;&amp;nbsp; Q01' = '2011 Q01'&lt;/P&gt;
&lt;P&gt;'2011&amp;nbsp;&amp;nbsp; Q02' = 'Q02'&lt;/P&gt;
&lt;P&gt;'2011&amp;nbsp;&amp;nbsp; Q03' = 'Q03'&lt;/P&gt;
&lt;P&gt;'2011&amp;nbsp;&amp;nbsp; Q04' = 'Q04'&lt;/P&gt;
&lt;P&gt;etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and add&lt;/P&gt;
&lt;P&gt;Format year_qtr $Myyrqtr.;&lt;/P&gt;
&lt;P&gt;to the gplot code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything else I can think of involves creating actual date variables. Then you could use a format to display the quarter and either ANNOTATE to get the year value (GPLOT)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or move over to using GTL, something similar to this: &lt;A href="http://support.sas.com/kb/35/169.html" target="_blank"&gt;http://support.sas.com/kb/35/169.html&lt;/A&gt;&amp;nbsp;again using actual dates, ignore the band, vector and scatter bits and use one Series statement with a GROUP variable.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 18:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272506#M9722</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-23T18:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272540#M9725</link>
      <description>&lt;P&gt;Just tried using a format statement&amp;nbsp;but for some reason it will only display the year now. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 19:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272540#M9725</guid>
      <dc:creator>einstein</dc:creator>
      <dc:date>2016-05-23T19:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272547#M9726</link>
      <description>&lt;P&gt;which format did you use?&lt;/P&gt;
&lt;P&gt;The example I created may not work with your data as I am not sure how many spaces (or other not visible) characters may have appeared in your actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 20:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272547#M9726</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-23T20:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272552#M9728</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nevermind! &amp;nbsp;It worked! You were right, there was an extra space in between the year and quarter I didn't account for. &amp;nbsp;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 20:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272552#M9728</guid>
      <dc:creator>einstein</dc:creator>
      <dc:date>2016-05-23T20:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272570#M9729</link>
      <description>&lt;P&gt;This is relatively easy with SGPLOT. &amp;nbsp;Using YYQ4. format on X axis with date values, I get this graph. &amp;nbsp;The split is automatic.&lt;/P&gt;
&lt;P&gt;Not sure I can get 'Q1' instead of '1', etc. &amp;nbsp;I will check.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3305iC08F4BDE1EFB84BC/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="YrQtr.png" title="YrQtr.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 21:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272570#M9729</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-05-23T21:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272581#M9730</link>
      <description>&lt;P&gt;Maybe a custom format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=work;
picture myqtr (default=7)   
low-high= '%Y Q%q' (datatype=date)
;
run; 

data junk;
   do date='05Jan2015'd, '10APR2015'd,'25JUL2015'd,'17OCT2015'd  ;
   output;
   end;
   format date myqtr.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 May 2016 23:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/272581#M9730</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-23T23:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275008#M9823</link>
      <description>&lt;P&gt;Does this code not work if you move to proc sgplot? &amp;nbsp;I changed the code to proc sgplot and now this format doesn't work anymore.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275008#M9823</guid>
      <dc:creator>einstein</dc:creator>
      <dc:date>2016-06-03T16:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275010#M9824</link>
      <description>&lt;P&gt;I tried this but it wouldn't just show the year for the first quarter. &amp;nbsp;It shows the two digit year and then quarter (11Q1 11Q2, etc.). &amp;nbsp;Is there something else I need to specify in the proc sgplot for this to work?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275010#M9824</guid>
      <dc:creator>einstein</dc:creator>
      <dc:date>2016-06-03T16:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Edit the labels in the x axis of a graph when displaying two variables (Year and Quarter)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275110#M9828</link>
      <description>&lt;P&gt;ah, I used the values and values display option and that seemed to solve the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 20:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Edit-the-labels-in-the-x-axis-of-a-graph-when-displaying-two/m-p/275110#M9828</guid>
      <dc:creator>einstein</dc:creator>
      <dc:date>2016-06-03T20:34:08Z</dc:date>
    </item>
  </channel>
</rss>

