<?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: reflabels in gplots in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37774#M1209</link>
    <description>Here are a couple of simple SGPLOT examples to show you how to make external reflabels and how to put the reflines in a legend:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgplot data=sashelp.class;&lt;BR /&gt;
scatter x=weight y=height;&lt;BR /&gt;
refline 60 / labelloc=outside label="This is a label";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=sashelp.class;&lt;BR /&gt;
scatter x=weight y=height;&lt;BR /&gt;
refline 60 / labelloc=outside lineattrs=(color=blue) legendlabel="Value=60" name="r";&lt;BR /&gt;
refline 70 / labelloc=outside lineattrs=(color=red) legendlabel="Value=70" name="s";&lt;BR /&gt;
keylegend "r" "s";&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Fri, 25 Mar 2011 16:20:05 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2011-03-25T16:20:05Z</dc:date>
    <item>
      <title>reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37770#M1205</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I have a query to ask. I am in the process of annotating my gplot in sas 9.2. I have used reflabels to name my vref. The problem is the text is hardly visible with all the data. I have tried to change the colours to see if i can make it more visible. But it doesnt seem to work.&lt;BR /&gt;
&lt;BR /&gt;
I was wondering if its possible to make the reflabels appear outside the plotted data ie the frame

Message was edited by: neophyte</description>
      <pubDate>Thu, 24 Mar 2011 09:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37770#M1205</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-24T09:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37771#M1206</link>
      <description>Hey,&lt;BR /&gt;
&lt;BR /&gt;
There are a few alternatives. If you stick with GPLOT, you may be able to set the axis length in a way to reserve space for an outside reflabel, and you can annotate the label. Instead of moving it outside, you may also be able to set an axis offset to make room for the label. Another alternative is to use SGPLOT instead, which has an option to put the refline labels inside or outside of the data area. If your interested in trying SGPLOT, just post more information about what you're trying to plot and I'll see if I can give you some SGPLOT code to make it.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Thu, 24 Mar 2011 12:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37771#M1206</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2011-03-24T12:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37772#M1207</link>
      <description>HI Dan&lt;BR /&gt;
&lt;BR /&gt;
Thanks for getting back to me. If I want to stick with gplot, how can i offset axis or set the axis length to make space for label?&lt;BR /&gt;
&lt;BR /&gt;
In terms of SGPLOT, I am basically trying to plot varb-y against varb-x (so something like,http://upload.wikimedia.org/wikipedia/commons/9/91/Bush_disapproval_ratings_line_graph.png). &lt;BR /&gt;
&lt;BR /&gt;
Sorry to be pain but if feasible, do you know if we can legend of vref rather than symbols, and if so how? &lt;BR /&gt;
&lt;BR /&gt;
I was trying to search on net, but almost all the info on legends is with symbols or different lines (which requires different dataset). But mine just contains 1 dataset but with different vref's.&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much</description>
      <pubDate>Fri, 25 Mar 2011 08:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37772#M1207</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-25T08:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37773#M1208</link>
      <description>I've created a little example that demonstrates how to control most of the things you're asking about...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
axis1 reflabel=(h=12pt 'skinny' 'ok' 'fat');&lt;BR /&gt;
axis2 offset=(0,2);&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=sashelp.class;&lt;BR /&gt;
plot height*weight /&lt;BR /&gt;
&lt;BR /&gt;
 haxis=axis1&lt;BR /&gt;
 href=(85 110 150)&lt;BR /&gt;
 chref=(red green purple)&lt;BR /&gt;
&lt;BR /&gt;
 vaxis=axis2&lt;BR /&gt;
 vref=(80)&lt;BR /&gt;
 cvref=(gray)&lt;BR /&gt;
 ;&lt;BR /&gt;
run;

Message was edited by: Robert Allison @ SAS</description>
      <pubDate>Fri, 25 Mar 2011 12:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37773#M1208</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2011-03-25T12:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37774#M1209</link>
      <description>Here are a couple of simple SGPLOT examples to show you how to make external reflabels and how to put the reflines in a legend:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgplot data=sashelp.class;&lt;BR /&gt;
scatter x=weight y=height;&lt;BR /&gt;
refline 60 / labelloc=outside label="This is a label";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=sashelp.class;&lt;BR /&gt;
scatter x=weight y=height;&lt;BR /&gt;
refline 60 / labelloc=outside lineattrs=(color=blue) legendlabel="Value=60" name="r";&lt;BR /&gt;
refline 70 / labelloc=outside lineattrs=(color=red) legendlabel="Value=70" name="s";&lt;BR /&gt;
keylegend "r" "s";&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 25 Mar 2011 16:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37774#M1209</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2011-03-25T16:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37775#M1210</link>
      <description>Hi Dan &lt;BR /&gt;
&lt;BR /&gt;
I have tried to do what you suggested - but its still giving me problems and I cant figure out why. I have pasted below my code and my log accompained with it. (if this helps)&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=exp;&lt;BR /&gt;
	scatter x= dpdate y= CBSELFCALSLP;&lt;BR /&gt;
	refline &amp;amp;A  / labelloc=outside lineattrs=refcurrslp pattern=3 thickness=2 color=grey LEGENDLABEL= "Label" name="r";&lt;BR /&gt;
	keylegend "r" ; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Log:&lt;/B&gt;&lt;BR /&gt;
394  proc sgplot data=exp;&lt;BR /&gt;
395      scatter x= dpdate y= CBSELFCALSLP;&lt;BR /&gt;
396      refline &amp;amp;ref_curr_slp  / labelloc=outside lineattrs=refcurrslp pattern=3 thickness=2&lt;BR /&gt;
                                                                        -------&lt;BR /&gt;
                                                                        79&lt;BR /&gt;
ERROR 79-322: Expecting a (.&lt;BR /&gt;
&lt;BR /&gt;
396!     refline &amp;amp;A  / labelloc=outside lineattrs=refcurrslp pattern=3 thickness=2&lt;BR /&gt;
396!  color=grey LEGENDLABEL= "Label" name="Name";&lt;BR /&gt;
                 -----------&lt;BR /&gt;
                 79&lt;BR /&gt;
ERROR 79-322: Expecting a ).&lt;BR /&gt;
397      keylegend "r" "s";&lt;BR /&gt;
398  run;&lt;BR /&gt;
&lt;B&gt;“&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Also I wanted to ask if I wanted to have more than 1 refline (with different colours/patterns/thickness/labels), then do I have to create a new refline everytime or I can do as following:&lt;BR /&gt;
	refline &amp;amp;A &amp;amp;B &amp;amp;C…  / labelloc=outside lineattrs=refcurrslp pattern=3 thickness=2 color=(grey black blue) LEGENDLABEL= ("LabelA" “LabelB”… name="A" “B”;</description>
      <pubDate>Mon, 28 Mar 2011 09:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37775#M1210</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-28T09:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37776#M1211</link>
      <description>Waiting Dan answer,&lt;BR /&gt;
check  ERROR 79-322: Expecting a (.      &lt;BR /&gt;
with a resubmit with mprint option&lt;BR /&gt;
something in the text substitued by the way of a macro variable&lt;BR /&gt;
is invalid   at line 322 of your  past submitted log&lt;BR /&gt;
&lt;BR /&gt;
so you should perhaps find by your self the solution to your problem &lt;BR /&gt;
&lt;BR /&gt;
Andre&lt;BR /&gt;
&lt;BR /&gt;
and lineattr=( )   was written so in dan's code

Message was edited by: Andre</description>
      <pubDate>Mon, 28 Mar 2011 09:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37776#M1211</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2011-03-28T09:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37777#M1212</link>
      <description>sure now &lt;BR /&gt;
your problem is syntaxic&lt;BR /&gt;
&lt;BR /&gt;
lineattrs=(  )&lt;BR /&gt;
&lt;BR /&gt;
see at page 1 of&lt;BR /&gt;
&lt;BR /&gt;
From "Using PROC SGPLOT for Quick High-Quality Graphs" by Susan J. Slaughter and Lora D. &lt;BR /&gt;
Delwiche, presented at SAS Global Forum 2010, Seattle, WA, paper 154-2010. &lt;BR /&gt;
&lt;BR /&gt;
at &lt;BR /&gt;
susanslaughter.files.wordpress.com/2010/04/sgplottables.pdf</description>
      <pubDate>Mon, 28 Mar 2011 10:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37777#M1212</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2011-03-28T10:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37778#M1213</link>
      <description>To fix our code, your line color, pattern and thickness should be in the ()'s:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgplot data=exp;&lt;BR /&gt;
scatter x= dpdate y= CBSELFCALSLP;&lt;BR /&gt;
refline &amp;amp;A / labelloc=outside lineattrs=(pattern=3 thickness=2 color=grey) LEGENDLABEL= "Label" name="r";&lt;BR /&gt;
keylegend "r" ; &lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
The only thing that can be out of the parens is a style element reference.&lt;BR /&gt;
&lt;BR /&gt;
To answer your other question, you can specify multiple values on a REFLINE statement (even a column variable), but they will all have the same attributes. For unique attributes, you have to use multiple statements.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps!&lt;BR /&gt;
Dan</description>
      <pubDate>Mon, 28 Mar 2011 12:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37778#M1213</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2011-03-28T12:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: reflabels in gplots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37779#M1214</link>
      <description>Thanks Dan&lt;BR /&gt;
&lt;BR /&gt;
You have been a great help.Thank you for replying back to my posts.</description>
      <pubDate>Fri, 01 Apr 2011 07:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/reflabels-in-gplots/m-p/37779#M1214</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-04-01T07:38:14Z</dc:date>
    </item>
  </channel>
</rss>

