<?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: Is there an option for hiding the vertical part of the lines in a SGPLOT STEP plot ? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-an-option-for-hiding-the-vertical-part-of-the-lines-in/m-p/646919#M19877</link>
    <description>&lt;P&gt;The GTL syntax that SGPLOT produces &lt;STRONG&gt;does&lt;/STRONG&gt; support the JOIN=false option to achieve the visual you want.&amp;nbsp; SGPLOT may not implement this option.&amp;nbsp; One way to do this to run your SGPLOT code with TMPLOUT="filename" option.&amp;nbsp; The generated GTL code will be saved in filename.&amp;nbsp; Then add the JOIN option to the generated STEPPLOT statement and run the GTL program.&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 01:20:46 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2020-05-12T01:20:46Z</dc:date>
    <item>
      <title>Is there an option for hiding the vertical part of the lines in a SGPLOT STEP plot ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-an-option-for-hiding-the-vertical-part-of-the-lines-in/m-p/646918#M19876</link>
      <description>&lt;P&gt;How can I use SGPLOT to produce a STEP plot that has the same look as a GPLOT with SYMBOL I=STEPL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data generator and z-normalize&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;data have(keep=location time measure intensity);
  call streaminit(202005);
  location = 'A'; time=0; 
  do k = 1 to 7; 
    measure = 10 + time; intensity=1+mod(k,4); output; 
    time + 1+rand('integer',1,12)/2; 
  end;  output;

  location = 'B'; time=0; 
  do k = k to k+6;
    measure = 20 + rand('uniform'); intensity=1+mod(k,4); output; 
    time + 1+rand('integer',1,12)/2; 
  end;  output;

  location = 'C'; time=0; 
  do k = k to k+6;
    measure = 30 - time; intensity=1+mod(k,4); output; 
    time + 1+rand('integer',1,12)/2; 
  end;  output;

  location = 'D'; time=0; 
  do k = k to k+6;
    measure = 6.5 + log(time*2); intensity=1+mod(k,4); output; 
    time + 1+rand('integer',1,12)/2; 
  end;  output;

  location = 'E'; time=0; 
  do k = k to k+6;
    measure = mod(time-1,3); intensity=1+mod(k,4); output; 
    time + 1+rand('integer',1,12)/2; 
  end;  output;
run;

proc sql;
  create table locations as select distinct location from have;

data location_ids;
  set locations;
  location_id + 1;
  retain fmtname 'locid';
run;

proc format cntlin=location_ids(rename=(location_id=start location=label));
run;

proc sql;
  * normalize measure by location to z in [-0.4 to 0.4] about location_id;
  create table have_z as
  select 
    have.location
  , location_ids.location_id
  , have.time
  , have.measure
  , (measure-min(measure)) / (max(measure) - min(measure)) * 0.8 - 0.4 as z_normal
  , mean(location_id) + calculated z_normal as z_level format=locid.
  , have.intensity
  from have
  join location_ids on have.location = location_ids.location
  group by location_id
  order by location_id, time
  ;

ods html file='step.html';
ods graphics / width=400px;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&lt;STRONG&gt;GPLOT (no vertical part)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;goptions xpixels=400 ypixels=300;
symbol1 i=stepL v=dot width=2 height=2;
axis1 label=none minor=none order=0 to 6 value=('' 'A' 'B' 'C' 'D' 'E' '');
axis2 label=none minor=none major=none value=none;

proc gplot data=have_z;
  title h=11pt "Measures, Normalized for Location (GPLOT)";
  plot z_level * time = location_id / nolegend vaxis=axis1 haxis=axis2;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardADeVenezia_0-1589245288090.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39314iBC9EACD7AF9481B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RichardADeVenezia_0-1589245288090.png" alt="RichardADeVenezia_0-1589245288090.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SGPLOT (how to remove vertical part ?)&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=have_z noautolegend;
  title h=11pt "Measures, Normalized for Location (SGPLOT)";
  step   x=time y=z_level / group=location_id lineattrs=(thickness=2px) markers markerattrs=(symbol=circlefilled size=8px);
  *bubble x=time y=z_level size=intensity / group=location_id bradiusmin=1 bradiusmax=6;
  xaxis integer display=none;
  yaxis integer display=(nolabel); 
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardADeVenezia_1-1589245449718.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39315i3F5AD6C6E403841E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RichardADeVenezia_1-1589245449718.png" alt="RichardADeVenezia_1-1589245449718.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>Tue, 12 May 2020 01:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-an-option-for-hiding-the-vertical-part-of-the-lines-in/m-p/646918#M19876</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-12T01:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option for hiding the vertical part of the lines in a SGPLOT STEP plot ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-an-option-for-hiding-the-vertical-part-of-the-lines-in/m-p/646919#M19877</link>
      <description>&lt;P&gt;The GTL syntax that SGPLOT produces &lt;STRONG&gt;does&lt;/STRONG&gt; support the JOIN=false option to achieve the visual you want.&amp;nbsp; SGPLOT may not implement this option.&amp;nbsp; One way to do this to run your SGPLOT code with TMPLOUT="filename" option.&amp;nbsp; The generated GTL code will be saved in filename.&amp;nbsp; Then add the JOIN option to the generated STEPPLOT statement and run the GTL program.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 01:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-an-option-for-hiding-the-vertical-part-of-the-lines-in/m-p/646919#M19877</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2020-05-12T01:20:46Z</dc:date>
    </item>
  </channel>
</rss>

