<?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 How to add vertical and horizontal lines in SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885139#M23984</link>
    <description>&lt;P&gt;Hi!&amp;nbsp; I want to add a vertical line and also a horizontal line, both of specific length,&lt;/P&gt;
&lt;P&gt;very close to the Y-axis&amp;nbsp; resp. X-axis in Proc SGPLOT.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;At present I do this on the PC using PAINT.NET (from Microsoft).&lt;/P&gt;
&lt;P&gt;(On the PC: name.svg --&amp;gt; take out the picture as&amp;nbsp; &amp;nbsp;screencopy.jpg&amp;nbsp; file. Use Paint.net).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;It works, but you can see on the details of the lines that my hand is not quite steady.&lt;BR /&gt;If possible I would like to specify the length and the position in SGPLOT.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fig4B E3 MM.png" style="width: 456px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85854i7FEDAAC7B94C465C/image-dimensions/456x342?v=v2" width="456" height="342" role="button" title="Fig4B E3 MM.png" alt="Fig4B E3 MM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps there is a better software than PAINT.net&amp;nbsp; to draw straight lines on a graph?&lt;/P&gt;
&lt;P&gt;Many thanks in advance!&lt;/P&gt;
&lt;P&gt;/Br Anders&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 17:54:16 GMT</pubDate>
    <dc:creator>AndersS</dc:creator>
    <dc:date>2023-07-17T17:54:16Z</dc:date>
    <item>
      <title>How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885139#M23984</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; I want to add a vertical line and also a horizontal line, both of specific length,&lt;/P&gt;
&lt;P&gt;very close to the Y-axis&amp;nbsp; resp. X-axis in Proc SGPLOT.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;At present I do this on the PC using PAINT.NET (from Microsoft).&lt;/P&gt;
&lt;P&gt;(On the PC: name.svg --&amp;gt; take out the picture as&amp;nbsp; &amp;nbsp;screencopy.jpg&amp;nbsp; file. Use Paint.net).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;It works, but you can see on the details of the lines that my hand is not quite steady.&lt;BR /&gt;If possible I would like to specify the length and the position in SGPLOT.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fig4B E3 MM.png" style="width: 456px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85854i7FEDAAC7B94C465C/image-dimensions/456x342?v=v2" width="456" height="342" role="button" title="Fig4B E3 MM.png" alt="Fig4B E3 MM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps there is a better software than PAINT.net&amp;nbsp; to draw straight lines on a graph?&lt;/P&gt;
&lt;P&gt;Many thanks in advance!&lt;/P&gt;
&lt;P&gt;/Br Anders&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 17:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885139#M23984</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-07-17T17:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885155#M23985</link>
      <description>&lt;P&gt;Use the LINEPARM statement in SGPLOT if you know ahead of time where you want to draw the lines.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1h6n82pw2uqo6n10avwmph63r7o.htm" target="_self"&gt;LINEPARM&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Creates a straight line specified by a point and a slope. You can generate a single line by specifying a constant for each required argument. You can generate multiple lines by specifying a numeric variable for any or all required arguments.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;EDIT: to limit the line, POLYGON may be better. Either way, I'd use some functionality within PROC SGPLOT to get it created.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 19:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885155#M23985</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-17T19:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885180#M23986</link>
      <description>&lt;P&gt;How exactly are you specifying "length"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adding coordinates for a Series or perhaps a Vector plot would be my idea. Here is an example placing a horizontal line. Provide a different pair of x and y variables for a vertical line. Note that I have cleverly picked a value for y of the horizontal line that is just above the starting value of the Yaxis values= list. If the space between is still too large you could use y values like 55.01 or what appears good to you.&lt;/P&gt;
&lt;PRE&gt;data myline;
   input xline yline;
datalines;
55 55.1
68 55.1
;

data toplot;
   set sashelp.class
       myline
   ;
run;

proc sgplot data=toplot;
   scatter x=height y=weight;
   series x=xline y=yline;
   xaxis values=(50 to 70 by 5);
   yaxis values=(55 to 135 by 20);
run;&lt;/PRE&gt;
&lt;P&gt;You could use the LINEATTRS option on the series for Xline and Yline to set color, linewidth and even a type as desired.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 12:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885180#M23986</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-07-18T12:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885247#M23987</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sganno
data sganno;
 %SGLINE(X1=0,Y1=0,X2=50,Y2=0,DRAWSPACE="DATAPERCENT" ,LINECOLOR="black" ,LINETHICKNESS=6)
 %SGLINE(X1=0,Y1=25,X2=0,Y2=50,DRAWSPACE="DATAPERCENT" ,LINECOLOR="black" ,LINETHICKNESS=6)
run;


data have;
 set sashelp.stocks;
 if stock='IBM';
run;
proc sgplot data=have noautolegend sganno=sganno;
loess x=date y=close;
xaxis offsetmin=0.01 ;
yaxis offsetmin=0.01 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1689680189380.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85875i3EDD16AE855AEFAA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1689680189380.png" alt="Ksharp_0-1689680189380.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885247#M23987</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-18T11:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885274#M23988</link>
      <description>HI! It works as is nice.</description>
      <pubDate>Tue, 18 Jul 2023 14:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885274#M23988</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-07-18T14:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885280#M23989</link>
      <description>&lt;P&gt;Hi! I used one "SERIES" for each line. Works VERY well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I asked one "stupid question" and reived three (3) VERY GOOD answers! ALL of them are working.&lt;/P&gt;
&lt;P&gt;This one is perhaps the simplest. But all solutions are of GREAT interest.&lt;/P&gt;
&lt;P&gt;MANY THANKS!&lt;/P&gt;
&lt;P&gt;/Br Anders&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 14:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885280#M23989</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-07-18T14:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885281#M23990</link>
      <description>&lt;P&gt;GANNO solution works well. The "SERIES" solution is simpler.&lt;/P&gt;
&lt;P&gt;BUT - I know now how to use GANNO ans similar. VERY useful.&lt;/P&gt;
&lt;P&gt;MANY THANKS!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 14:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885281#M23990</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-07-18T14:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885338#M23991</link>
      <description>&lt;P&gt;Hi! Do you have any good examples of the use of %SGTEXT ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your suggestion eralier was very useful, even if another one was simpler to use.&lt;/P&gt;
&lt;P&gt;/Br Anders&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 18:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885338#M23991</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-07-18T18:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885428#M23992</link>
      <description>Here is a good start for %sganno &lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Pi-Day-Challenge-Draw-Newton-s-diagram-for-approximating-pi/td-p/863164" target="_blank"&gt;https://communities.sas.com/t5/Graphics-Programming/Pi-Day-Challenge-Draw-Newton-s-diagram-for-approximating-pi/td-p/863164&lt;/A&gt;</description>
      <pubDate>Wed, 19 Jul 2023 11:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885428#M23992</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-19T11:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add vertical and horizontal lines in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885445#M23993</link>
      <description>&lt;P&gt;Many Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 12:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-vertical-and-horizontal-lines-in-SGPLOT/m-p/885445#M23993</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2023-07-19T12:41:51Z</dc:date>
    </item>
  </channel>
</rss>

