<?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: Title in 2 parts over a graphic with divergent X-axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891824#M24068</link>
    <description>&lt;P&gt;There are a few ways to of this, but this way is probably the most straightforward. The key here is the annotation, and the PAD option on the procedure. Let me know if you have any questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input x y;
cards;
-60 0
60  100
;
run;

data anno;
retain function "text" y1 100 drawspace "wallpercent" width 40
       anchor "bottom" textstyleelement "GraphTitleText";
input x1 label $ 4-12;
cards;
25 Title ABC
75 Title XYZ
;
run;

proc sgplot data=test sganno=anno pad=(top=30);
scatter x=x y=y;
refline 0 / axis=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Aug 2023 23:23:18 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2023-08-30T23:23:18Z</dc:date>
    <item>
      <title>Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891814#M24064</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've created the graphic in the attachment via Sgplot. However, I also need to add 2 titles at the same level over the graphic. The graphic has a divergent x-axis (of course, the left side is actually negative but formatted as positive for printing). One title should appear on the left side of the 0 base axis-line, the other title on the right side of this 0 base axis-line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The title statement only offers left, right and center, the "left option" sends the "title ABC" way far to the left, the "center option" overlaps the "title XYZ".&amp;nbsp; The title XYZ luckily locates well with the option "right".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sugestions on how to precisely locate the 2 titles in the same line in this case? Thanks for your time.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Karl&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 22:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891814#M24064</guid>
      <dc:creator>Karolus</dc:creator>
      <dc:date>2023-08-30T22:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891816#M24065</link>
      <description>&lt;P&gt;p.s.&amp;nbsp; I don't see my atachment...trying again.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 22:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891816#M24065</guid>
      <dc:creator>Karolus</dc:creator>
      <dc:date>2023-08-30T22:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891817#M24066</link>
      <description>&lt;P&gt;The graph didn't get attached.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 22:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891817#M24066</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-08-30T22:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891818#M24067</link>
      <description>yeah, I noticed, I just added it</description>
      <pubDate>Wed, 30 Aug 2023 22:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891818#M24067</guid>
      <dc:creator>Karolus</dc:creator>
      <dc:date>2023-08-30T22:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891824#M24068</link>
      <description>&lt;P&gt;There are a few ways to of this, but this way is probably the most straightforward. The key here is the annotation, and the PAD option on the procedure. Let me know if you have any questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input x y;
cards;
-60 0
60  100
;
run;

data anno;
retain function "text" y1 100 drawspace "wallpercent" width 40
       anchor "bottom" textstyleelement "GraphTitleText";
input x1 label $ 4-12;
cards;
25 Title ABC
75 Title XYZ
;
run;

proc sgplot data=test sganno=anno pad=(top=30);
scatter x=x y=y;
refline 0 / axis=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2023 23:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891824#M24068</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-08-30T23:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891837#M24069</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15428"&gt;@Karolus&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The title statement only offers left, right and center, the "left option" sends the "title ABC" way far to the left, the "center option" overlaps the "title XYZ".&amp;nbsp; The title XYZ luckily locates well with the option "right".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can "pad" text so it appears that things are not all the way to the left&lt;/P&gt;
&lt;PRE&gt;title justify=left "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Some left text" justify=right "And some right text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
proc print data=sashelp.class (obs=5);
run;
&lt;/PRE&gt;
&lt;P&gt;The "spaces" in the text are actually null, ASCII 255 characters and don't get stripped out the way a simple space might. More of a "something that may work occasionally" then an always do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 01:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891837#M24069</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-31T01:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891915#M24070</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
You could pad some blanks in TITLE
*/

title 'XXXXX                                                 YYYYY';
proc sgplot data=sashelp.heart;
hbar bp_status/response=weight group=sex;
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-1693484132653.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87363i5CB5578B263EB73A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1693484132653.png" alt="Ksharp_0-1693484132653.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 12:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891915#M24070</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-08-31T12:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891998#M24071</link>
      <description>&lt;P&gt;Using spaces is an option, particularly is this is a "one-off" graph. However, if this is something you will re-use, possible at different sizes and with different output types, you'll want to use an approach that guarantees that the text will be anchored in the correct location.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 16:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/891998#M24071</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-08-31T16:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Title in 2 parts over a graphic with divergent X-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/892030#M24072</link>
      <description>&lt;P&gt;Thank you Dan, &lt;BR /&gt;&lt;BR /&gt;an elegant solution, btw, after this I found your paper about annotating graphs, all very useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Karl&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 18:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Title-in-2-parts-over-a-graphic-with-divergent-X-axis/m-p/892030#M24072</guid>
      <dc:creator>Karolus</dc:creator>
      <dc:date>2023-08-31T18:39:30Z</dc:date>
    </item>
  </channel>
</rss>

