<?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: draw time line plot using proc gplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/draw-time-line-plot-using-proc-gplot/m-p/372299#M12861</link>
    <description>&lt;P&gt;Hi Panda,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create the annotate data seem to be the right way to draw the timeline,&amp;nbsp; but you&amp;nbsp;might need to change&amp;nbsp;your data&amp;nbsp;shape like start and stop&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id activity start stop&lt;/P&gt;&lt;P&gt;1&amp;nbsp; work&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; xx:xx1&amp;nbsp; yy:yy1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; work&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; xx:xx2&amp;nbsp; yy:yy2&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;rounds&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xx:xx3&amp;nbsp; yy:yy3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create three annotate datasets by activity and then put them together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;change the axis statement like following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Axis1 order=('00:00:00't to '24:00:00't by 3600)&amp;nbsp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it would draw&amp;nbsp; bunch of dash lines for the subjects and their activity if they have multiple sessions.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;good luck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jun 2017 20:16:51 GMT</pubDate>
    <dc:creator>fy1</dc:creator>
    <dc:date>2017-06-30T20:16:51Z</dc:date>
    <item>
      <title>draw time line plot using proc gplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/draw-time-line-plot-using-proc-gplot/m-p/371359#M12835</link>
      <description>&lt;P&gt;Hi all -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to draw a time line plot, the x-axis is start and stop times, and y-axis is id, each id has three rows of observations (activity), the data set looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;id &amp;nbsp;activity start000 stop000 start001 stop001 start002 stop002 start003 stop003&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; work &amp;nbsp; &amp;nbsp; 0:23 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0:54 &amp;nbsp; &amp;nbsp; &amp;nbsp;1:20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1:34 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2:25 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2:40 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:43 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:54&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; rounds &amp;nbsp;0:43 &amp;nbsp; &amp;nbsp; &amp;nbsp;0:50 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1:12 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1:45 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2:32 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2:45 &amp;nbsp; &amp;nbsp; &amp;nbsp;3:21 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:32&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; edu &amp;nbsp; &amp;nbsp; &amp;nbsp; 0:10 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0:43 &amp;nbsp; &amp;nbsp; &amp;nbsp;1:23 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1:28 &amp;nbsp; &amp;nbsp; &amp;nbsp;2:03 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2:55 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:08 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:43&lt;/P&gt;&lt;P&gt;2 &amp;nbsp;work &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1:43 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1:50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:23 &amp;nbsp; &amp;nbsp; &amp;nbsp;3:26&lt;/P&gt;&lt;P&gt;2 &amp;nbsp;rounds &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2:45 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3:54&lt;/P&gt;&lt;P&gt;2 &amp;nbsp;edu &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:10 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3:55&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a link using proc gplot to draw this graph, I tried the code but did not work very well. The sample graph and code is attached here (&lt;A title="create a time line plot with PROC GPLOT" href="http://support.sas.com/kb/24/937.html" target="_self"&gt;http://support.sas.com/kb/24/937.html&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9921i5F16085986D82FB2/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="fusion_24937_1_g24937.gif" title="fusion_24937_1_g24937.gif" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; /* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;  

 /* Create a sample data set */
data a;
   input Material $ Start Stop Linetype;
   datalines;
A 4 7 1
B 1 6 2
C 3 9 1
D 2 8 2
E 1 7 1
;
run;

 /* Create the annotate data set to use with */
 /* PROC GPLOT.                              */
data anno;
   length function color $8;
   retain xsys ysys '2' size 2 color 'vibg';
   set a;
   line=linetype;
   function='move'; 
   x=start; yc=Material; 
   output;
   function='draw'; 
   x=stop; yc=Material; 
   output;
run;

axis1 order=(0 to 10) label=('Start - Stop') minor=none;
symbol1 interpol=none value=none;

 /* Add a title to the graph */
title1 'Time Line';

 /* Create the graph using the ANNO= */
 /* option on the PLOT statement.    */
proc gplot data=a;
   plot Material*stop / anno=anno haxis=axis1;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I think the main problem right now is that my time format is exact time, not exact number like from 0 to 10, and I have&amp;nbsp;&lt;/P&gt;&lt;P&gt;mutiple start and stop time varibles.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have ideas on how to draw the graph?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 16:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/draw-time-line-plot-using-proc-gplot/m-p/371359#M12835</guid>
      <dc:creator>panda</dc:creator>
      <dc:date>2017-06-28T16:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: draw time line plot using proc gplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/draw-time-line-plot-using-proc-gplot/m-p/372299#M12861</link>
      <description>&lt;P&gt;Hi Panda,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create the annotate data seem to be the right way to draw the timeline,&amp;nbsp; but you&amp;nbsp;might need to change&amp;nbsp;your data&amp;nbsp;shape like start and stop&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id activity start stop&lt;/P&gt;&lt;P&gt;1&amp;nbsp; work&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; xx:xx1&amp;nbsp; yy:yy1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; work&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; xx:xx2&amp;nbsp; yy:yy2&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;rounds&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xx:xx3&amp;nbsp; yy:yy3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create three annotate datasets by activity and then put them together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;change the axis statement like following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Axis1 order=('00:00:00't to '24:00:00't by 3600)&amp;nbsp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it would draw&amp;nbsp; bunch of dash lines for the subjects and their activity if they have multiple sessions.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;good luck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 20:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/draw-time-line-plot-using-proc-gplot/m-p/372299#M12861</guid>
      <dc:creator>fy1</dc:creator>
      <dc:date>2017-06-30T20:16:51Z</dc:date>
    </item>
  </channel>
</rss>

