<?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 GPLOT Legend Style in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/459544#M15851</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a line plot with gplot procedure, and would like to change the appearance of the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are my codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The look of my legend is&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 380px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20328i69EBDA4BC85D65D3/image-dimensions/380x38?v=v2" width="380" height="38" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the style I want is&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.PNG" style="width: 392px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20329i22F3EBA83335DED2/image-dimensions/392x56?v=v2" width="392" height="56" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I can use &lt;STRONG&gt;repeat = N&amp;nbsp;&lt;/STRONG&gt;to control the number of dots in the legend,&lt;/P&gt;&lt;P&gt;and I can use shape = symbol(width, height) to change the size and width of the the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I am using both, say&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;legend1 label = NONE repeat =&amp;nbsp;1 shape = symbol(50 pt, 10 pt) FRAME position = (TOP RIGHT INSIDE);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It will end up to be like this&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 336px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20330iB1FDF1A35DBD52EA/image-dimensions/336x74?v=v2" width="336" height="74" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i.e. by defining repeat = 1, I am losing the ability of changing the width of legend shape.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone know how to do it?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ADEFF;&lt;BR /&gt;label AVAL = "Analysis Value"&lt;BR /&gt;AVISITN = "Analysis Visit (N)"&lt;BR /&gt;TRTPN = "Planned Treatment (N)";&lt;BR /&gt;input TRTPN AVISITN AVAL @@;&lt;BR /&gt;datalines;&lt;BR /&gt;1 0 9.40 2 0 9.55&lt;BR /&gt;1 1 9.35 2 1 9.45&lt;BR /&gt;1 2 8.22 2 2 8.78&lt;BR /&gt;1 3 6.33 2 3 8.23&lt;BR /&gt;1 4 4.00 2 4 7.77&lt;BR /&gt;1 5 2.22 2 5 4.46&lt;BR /&gt;1 6 1.44 2 6 2.00&lt;BR /&gt;1 7 1.13 2 7 1.86&lt;BR /&gt;1 8 0.55 2 8 1.44&lt;BR /&gt;1 9 0.67 2 9 1.33&lt;BR /&gt;1 10 0.45 2 10 1.01&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value avisitn&lt;BR /&gt;0 = "Baseline"&lt;BR /&gt;1 = "Day 1"&lt;BR /&gt;2 = "Day 2"&lt;BR /&gt;3 = "Day 3"&lt;BR /&gt;4 = "Day 4"&lt;BR /&gt;5 = "Day 5"&lt;BR /&gt;6 = "Day 6"&lt;BR /&gt;7 = "Day 7"&lt;BR /&gt;8 = "Day 8"&lt;BR /&gt;9 = "Day 9"&lt;BR /&gt;10 = "Day 10";&lt;BR /&gt;value trtpn&lt;BR /&gt;1 = "Super Drug"&lt;BR /&gt;2 = "Old Drug";&lt;BR /&gt;run;&lt;BR /&gt;symbol1 v = dot i = join line = 1 c = black;&lt;BR /&gt;symbol2 v = circle i = join line = 2 c = black;&lt;/P&gt;&lt;P&gt;data anno;&lt;BR /&gt;retain xsys ysys "2";&lt;BR /&gt;x = 1; y = 0; function = "move"; output;&lt;BR /&gt;x = 1; y = 10; function = "draw";line = 33; size = 1; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = anno;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title "Mean Clinical Response by Visit";&lt;BR /&gt;axis1 label = (angle = 90 "Mean Clinical Response") minor = none major = none;&lt;BR /&gt;axis2 label = ("Visit") minor = none;&lt;BR /&gt;legend1 label = NONE repeat = 3 shape = symbol(50 pt, 10 pt) FRAME position = (TOP RIGHT INSIDE);&lt;BR /&gt;proc gplot data = ADEFF;&lt;BR /&gt;plot aval * avisitn = trtpn/ haxis = axis2 vaxis = axis1 legend = legend1 annotate = anno;&lt;BR /&gt;format avisitn avisitn.;&lt;BR /&gt;format trtpn trtpn.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 May 2018 06:00:27 GMT</pubDate>
    <dc:creator>MorningPanda</dc:creator>
    <dc:date>2018-05-03T06:00:27Z</dc:date>
    <item>
      <title>GPLOT Legend Style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/459544#M15851</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a line plot with gplot procedure, and would like to change the appearance of the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are my codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The look of my legend is&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 380px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20328i69EBDA4BC85D65D3/image-dimensions/380x38?v=v2" width="380" height="38" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the style I want is&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.PNG" style="width: 392px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20329i22F3EBA83335DED2/image-dimensions/392x56?v=v2" width="392" height="56" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I can use &lt;STRONG&gt;repeat = N&amp;nbsp;&lt;/STRONG&gt;to control the number of dots in the legend,&lt;/P&gt;&lt;P&gt;and I can use shape = symbol(width, height) to change the size and width of the the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I am using both, say&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;legend1 label = NONE repeat =&amp;nbsp;1 shape = symbol(50 pt, 10 pt) FRAME position = (TOP RIGHT INSIDE);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It will end up to be like this&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 336px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20330iB1FDF1A35DBD52EA/image-dimensions/336x74?v=v2" width="336" height="74" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i.e. by defining repeat = 1, I am losing the ability of changing the width of legend shape.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone know how to do it?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ADEFF;&lt;BR /&gt;label AVAL = "Analysis Value"&lt;BR /&gt;AVISITN = "Analysis Visit (N)"&lt;BR /&gt;TRTPN = "Planned Treatment (N)";&lt;BR /&gt;input TRTPN AVISITN AVAL @@;&lt;BR /&gt;datalines;&lt;BR /&gt;1 0 9.40 2 0 9.55&lt;BR /&gt;1 1 9.35 2 1 9.45&lt;BR /&gt;1 2 8.22 2 2 8.78&lt;BR /&gt;1 3 6.33 2 3 8.23&lt;BR /&gt;1 4 4.00 2 4 7.77&lt;BR /&gt;1 5 2.22 2 5 4.46&lt;BR /&gt;1 6 1.44 2 6 2.00&lt;BR /&gt;1 7 1.13 2 7 1.86&lt;BR /&gt;1 8 0.55 2 8 1.44&lt;BR /&gt;1 9 0.67 2 9 1.33&lt;BR /&gt;1 10 0.45 2 10 1.01&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value avisitn&lt;BR /&gt;0 = "Baseline"&lt;BR /&gt;1 = "Day 1"&lt;BR /&gt;2 = "Day 2"&lt;BR /&gt;3 = "Day 3"&lt;BR /&gt;4 = "Day 4"&lt;BR /&gt;5 = "Day 5"&lt;BR /&gt;6 = "Day 6"&lt;BR /&gt;7 = "Day 7"&lt;BR /&gt;8 = "Day 8"&lt;BR /&gt;9 = "Day 9"&lt;BR /&gt;10 = "Day 10";&lt;BR /&gt;value trtpn&lt;BR /&gt;1 = "Super Drug"&lt;BR /&gt;2 = "Old Drug";&lt;BR /&gt;run;&lt;BR /&gt;symbol1 v = dot i = join line = 1 c = black;&lt;BR /&gt;symbol2 v = circle i = join line = 2 c = black;&lt;/P&gt;&lt;P&gt;data anno;&lt;BR /&gt;retain xsys ysys "2";&lt;BR /&gt;x = 1; y = 0; function = "move"; output;&lt;BR /&gt;x = 1; y = 10; function = "draw";line = 33; size = 1; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = anno;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title "Mean Clinical Response by Visit";&lt;BR /&gt;axis1 label = (angle = 90 "Mean Clinical Response") minor = none major = none;&lt;BR /&gt;axis2 label = ("Visit") minor = none;&lt;BR /&gt;legend1 label = NONE repeat = 3 shape = symbol(50 pt, 10 pt) FRAME position = (TOP RIGHT INSIDE);&lt;BR /&gt;proc gplot data = ADEFF;&lt;BR /&gt;plot aval * avisitn = trtpn/ haxis = axis2 vaxis = axis1 legend = legend1 annotate = anno;&lt;BR /&gt;format avisitn avisitn.;&lt;BR /&gt;format trtpn trtpn.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 06:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/459544#M15851</guid>
      <dc:creator>MorningPanda</dc:creator>
      <dc:date>2018-05-03T06:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: GPLOT Legend Style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/459560#M15852</link>
      <description>&lt;P&gt;Move to proc sgplot and GTL, gplot is really old.&amp;nbsp; When you do you will have a lot more control over your graphs and will find it far simpler.&amp;nbsp; You can read through the posts in this blog:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Which have examples of anything you can think of with code.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 08:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/459560#M15852</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-03T08:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: GPLOT Legend Style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/460116#M15878</link>
      <description>&lt;P&gt;Unfortunately, I don't think gplot's legend statement will let you do what you're wanting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, as always, if you're willing to do a little extra custom coding, you could 'fake' the legend you're wanting with annotate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data anno_legend;&lt;BR /&gt;length function $8 style $35 text $100;&lt;BR /&gt;xsys='1'; ysys='1'; hsys='3'; when='a';&lt;/P&gt;
&lt;P&gt;function='move'; x=50; y=95; output;&lt;BR /&gt;function='draw'; x=60; line=1; color='black'; size=.001; output;&lt;BR /&gt;function='label'; x=55; position='+'; style='albany amt/unicode'; text='25cf'x; color='black'; size=4.0; output;&lt;BR /&gt;function='label'; x=61; position='&amp;gt;'; style=''; size=2.5; text='Super drug'; output;&lt;/P&gt;
&lt;P&gt;function='move'; x=75; y=95; output;&lt;BR /&gt;function='draw'; x=85; line=3; color='black'; size=.001; output;&lt;BR /&gt;function='label'; x=80; position='+'; style='albany amt/unicode'; text='25cb'x; color='black'; size=4.0; output;&lt;BR /&gt;function='label'; x=86; position='&amp;gt;'; style=''; size=2.5; text='Old drug'; output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gplot11.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20372iAE9FD2061AB95034/image-size/large?v=v2&amp;amp;px=999" role="button" title="gplot11.png" alt="gplot11.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 17:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GPLOT-Legend-Style/m-p/460116#M15878</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2018-05-04T17:35:30Z</dc:date>
    </item>
  </channel>
</rss>

