<?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: Problems with legend unix in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60116#M2020</link>
    <description>Hi Robert&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much for your efforts. Do you think that annotate might be a solution? &lt;BR /&gt;
&lt;BR /&gt;
br&lt;BR /&gt;
Jenny</description>
    <pubDate>Fri, 19 Feb 2010 15:58:25 GMT</pubDate>
    <dc:creator>Jennys</dc:creator>
    <dc:date>2010-02-19T15:58:25Z</dc:date>
    <item>
      <title>Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60110#M2014</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
I have a linegraph where the labels for each line is long. If the legend contains a lot of explanation text for the lines, the text overlaps. If I change the x- and ypixels, the graph gets bigger and the text in the legend get supersmall. &lt;BR /&gt;
&lt;BR /&gt;
Is there a way to tell graph that the graph itself should be x*y pixels big and the rest should be left to the legend? So the text won´t be resized.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
br&lt;BR /&gt;
jenny</description>
      <pubDate>Fri, 19 Feb 2010 13:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60110#M2014</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2010-02-19T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60111#M2015</link>
      <description>What proc are you using? (proc gplot?)&lt;BR /&gt;
What output device are you using? (device=gif? java? activex? other?)&lt;BR /&gt;
Are you specifying any "goptions htext" size?  or gunit=pct, etc?&lt;BR /&gt;
And are you doing anything "tricky" such as using "proc greplay"?&lt;BR /&gt;
&lt;BR /&gt;
The sizing of the legends, and other text can depend on several things.</description>
      <pubDate>Fri, 19 Feb 2010 13:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60111#M2015</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-02-19T13:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60112#M2016</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
I run a proc gplot with no tricky things except the legend.&lt;BR /&gt;
  &lt;BR /&gt;
				legend1 &lt;BR /&gt;
					label = none&lt;BR /&gt;
					position =(bottom center)&lt;BR /&gt;
					value = (&amp;amp;longvalues);&lt;BR /&gt;
&lt;BR /&gt;
Theese are the goptions I have:&lt;BR /&gt;
&lt;BR /&gt;
goptions ftext=Verdana htext=0.5 device = javaimg colors=("#008040" "#99CCFF" "#99FFFF"  "#66FF66");&lt;BR /&gt;
&lt;BR /&gt;
br&lt;BR /&gt;
Jenny</description>
      <pubDate>Fri, 19 Feb 2010 13:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60112#M2016</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2010-02-19T13:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60113#M2017</link>
      <description>Hmm ... the dev=javaimg is a likely candidate ... it might only have "partial support" of the SAS/Graph options that control the legend size.&lt;BR /&gt;
&lt;BR /&gt;
If you want the most complete control of everything in the graph (such as the legend text size), I'd recommend using device=png (or device=gif).  Also, I'd recommend specifying a specific point-size for the text, such as ...&lt;BR /&gt;
&lt;BR /&gt;
   goptions htext=10pt;&lt;BR /&gt;
&lt;BR /&gt;
Or, if you want the legend to be a specific size, different from the rest of the text, you can control that via  a legend statement, something like ...&lt;BR /&gt;
&lt;BR /&gt;
   legend1 value=(height=10pt);</description>
      <pubDate>Fri, 19 Feb 2010 13:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60113#M2017</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-02-19T13:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60114#M2018</link>
      <description>Here is an example that illustrates my problem:&lt;BR /&gt;
If I change the array to 10 items, it looks ok. But with 18 the text get too small.&lt;BR /&gt;
If I change the ypixels to 1000 the graph gets bigger but not the legend.&lt;BR /&gt;
&lt;BR /&gt;
goptions dev =javaimg xpixels=640 ypixels=480;&lt;BR /&gt;
data fmt;&lt;BR /&gt;
fmtname = '$ATCFMT';&lt;BR /&gt;
length label $160;&lt;BR /&gt;
start="0 ";end= "0 ";label="saknas ";output;&lt;BR /&gt;
start="A ";end= "A ";label="MATSMALTNINGSORGAN OCH AMNESOMSATTNING ";output;&lt;BR /&gt;
start="B ";end= "B ";label="BLOD OCH BLODBILDANDE ORGAN ";output;&lt;BR /&gt;
start="C ";end= "C ";label="HJARTA OCH KRETSLOPP ";output;&lt;BR /&gt;
start="D ";end= "D ";label="HUD ";output;&lt;BR /&gt;
start="G ";end= "G ";label="URIN- OCH KONSORGAN SAMT KONSHORMONER ";output;&lt;BR /&gt;
start="H ";end= "H ";label="HORMONER EXKL KONSHORMONER ";output;&lt;BR /&gt;
start="J ";end= "J ";label="INFEKTIONSSJUKDOMAR ";output;&lt;BR /&gt;
start="L ";end= "L ";label="TUMORER OCH RUBBNINGAR I IMMUNSYSTEMET ";output;&lt;BR /&gt;
start="M ";end= "M ";label="RORELSEAPPARATEN ";output;&lt;BR /&gt;
start="N ";end= "N ";label="NERVSYSTEMET ";output;&lt;BR /&gt;
start="P ";end= "P ";label="ANTIPARASITARA, INSEKTSDODANDE OCH REPEL ";output;&lt;BR /&gt;
start="Q ";end= "Q ";label="gentamycin,betametazon,klotrimazol ";output;&lt;BR /&gt;
start="R ";end= "R ";label="ANDNINGSORGANEN ";output;&lt;BR /&gt;
start="S ";end= "S ";label="OGON OCH ORON ";output;&lt;BR /&gt;
start="T ";end= "T ";label="DIALYSVAROR (ASF) ";output;&lt;BR /&gt;
start="U ";end= "U ";label="ISOTOPER (ASF) ";output;&lt;BR /&gt;
start="V ";end= "V ";label="VARIA ";output;&lt;BR /&gt;
start="W ";end= "W ";label="TILLFALLIGA HANDELSVAROR ";output;&lt;BR /&gt;
start="X ";end= "X ";label="HANDELSVAROR ";output;&lt;BR /&gt;
start="Y ";end= "Y ";label="FORBRUKNINGSARTIKLAR ";output;&lt;BR /&gt;
start="Z ";end= "Z ";label="TILLBEHOR ";output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
  set fmt;&lt;BR /&gt;
  start = compress(start);&lt;BR /&gt;
  end = compress(end);&lt;BR /&gt;
  label = strip(label);&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  proc format cntlin = b;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
data test(keep = sex2 value height);&lt;BR /&gt;
  set sashelp.class;&lt;BR /&gt;
  length sex2 $160;&lt;BR /&gt;
  array kon (18) $ ('A','B','C','D','E','F','G','H','I','J','K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R');&lt;BR /&gt;
    do i = 1 to dim(kon);&lt;BR /&gt;
      sex2 = propcase(put(kon(i),$ATCFMT.));&lt;BR /&gt;
      value = ranuni(0);&lt;BR /&gt;
	  output;&lt;BR /&gt;
    end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sort data = test;&lt;BR /&gt;
  by value;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  proc sql noprint;&lt;BR /&gt;
				  select distinct(quote(strip(sex2))) into: longvalues separated ' '&lt;BR /&gt;
				  from test;&lt;BR /&gt;
				quit;  &lt;BR /&gt;
&lt;BR /&gt;
				&lt;BR /&gt;
&lt;BR /&gt;
legend1 &lt;BR /&gt;
					label = none&lt;BR /&gt;
					position =(bottom center)&lt;BR /&gt;
					across = 1&lt;BR /&gt;
					value = (h=1 &amp;amp;longvalues)&lt;BR /&gt;
					;&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data = test;&lt;BR /&gt;
			plot height*value=sex2  / &lt;BR /&gt;
				legend = legend1&lt;BR /&gt;
				cframe=cxFFFFFF&lt;BR /&gt;
				&lt;BR /&gt;
				;&lt;BR /&gt;
&lt;BR /&gt;
		run;</description>
      <pubDate>Fri, 19 Feb 2010 13:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60114#M2018</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2010-02-19T13:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60115#M2019</link>
      <description>I've downloaded/saved your sample, and experimented a little in v9.2, and confirmed that the legend &amp;amp; legend text just "do not work well" with dev=javaimg.&lt;BR /&gt;
&lt;BR /&gt;
If you use dev=png (rather than dev=javaimg), and the following options, it works fine (ie, the legend &amp;amp; graph resize as needed, and "play well together"):&lt;BR /&gt;
&lt;BR /&gt;
goptions dev=png xpixels=640 ypixels=1000;&lt;BR /&gt;
goptions htitle=14pt htext=10pt ftitle="albany amt/bold" ftext="albany amt";&lt;BR /&gt;
&lt;BR /&gt;
legend1 label=none position=(bottom center) value=(&amp;amp;longvalues) repeat=1;&lt;BR /&gt;
&lt;BR /&gt;
-----&lt;BR /&gt;
&lt;BR /&gt;
Also, if you want to specifically want to control the size of the plot (such that it stays a fixed size, rather than increasing when you increase the ypixels), you can do that with a legend statement, such as...&lt;BR /&gt;
&lt;BR /&gt;
axis1 length=5in;&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data = test;&lt;BR /&gt;
plot height*value=sex2  / legend=legend1 cframe=cxFFFFFF vaxis=axis1;</description>
      <pubDate>Fri, 19 Feb 2010 14:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60115#M2019</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-02-19T14:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60116#M2020</link>
      <description>Hi Robert&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much for your efforts. Do you think that annotate might be a solution? &lt;BR /&gt;
&lt;BR /&gt;
br&lt;BR /&gt;
Jenny</description>
      <pubDate>Fri, 19 Feb 2010 15:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60116#M2020</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2010-02-19T15:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60117#M2021</link>
      <description>I don't think that annotating the legend text manually with dev=javaimg would be possible.&lt;BR /&gt;
&lt;BR /&gt;
The main problem I foresee is that in order for annotate to have blank space under the graph to annotate the text onto, you'd want to use a blank "footnote" to add space under the graph ... but since device=javaimg does not support gtitles (ie, titles in the graph area, like dev=png/gif does) you can't use a blank footnote to add this white-space.&lt;BR /&gt;
&lt;BR /&gt;
   footnote1 height=3in " ";&lt;BR /&gt;
&lt;BR /&gt;
Another problem you'd be likely to run into is that dev=javaimg probably doesn't support all the annotate stuff you might want to use.  I haven't tried annotate with the java/javaimg lately, but last time I tried there were enough things not supported, that I couldn't do what I wanted with it.&lt;BR /&gt;
&lt;BR /&gt;
java/javaimg is good for making a quick/pretty *simple* graph, but when you want to do a complex graph, or have the maximum control overy your graph's appearance, I strongly recommend using the old/traditional devices such as dev=png or dev=gif, etc.</description>
      <pubDate>Fri, 19 Feb 2010 16:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60117#M2021</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-02-19T16:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with legend unix</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60118#M2022</link>
      <description>Thank you. You saved me a lot of time. I will try to make it look nice either with png or just shorten the labels.&lt;BR /&gt;
&lt;BR /&gt;
Have a nice weekend.</description>
      <pubDate>Fri, 19 Feb 2010 16:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Problems-with-legend-unix/m-p/60118#M2022</guid>
      <dc:creator>Jennys</dc:creator>
      <dc:date>2010-02-19T16:35:28Z</dc:date>
    </item>
  </channel>
</rss>

