Data visualization with SAS programming

GPLOT titling issue

Reply
Contributor
Posts: 73

GPLOT titling issue

GPLOT titling issue

I am using V9.2 for Windows.

I have 4 title lines, TITLE1-4, that I want to output. Everything worked until I tried to reuse TITLE2 for a second plot. If I define TITLE2 after defining TITLE3 & TITLE4, the last 2 title lines don't come out.  Is there a way to preserve titles 3 & 4 when I change title 2?

Super User
Posts: 5,360

Re: GPLOT titling issue

John,

Can't be done, sort of.  Titles are designed to work that way.  Quick, short solutions include changing the order of the titles so that the one that changes is the last one, or repeating your TITLE3 and TITLE4 statements once you change TITLE2.

In theory, you could write a macro to do this.  After all, current title settings are stored in dictionary.titles.  So you could capture the current settings, replace TITLE2, and then use the captured values to reinstate TITLE3 and TITLE4.  But nobody I know has ever wanted to jump through that hoop.  The quick solutions I first mentioned are the ones that most people choose.

Good luck.

Super User
Posts: 11,114

Re: GPLOT titling issue

If this occurs in enough places and you don't want to copy paste a lot, especially when making changes you could use a short macro.

%macro bottomtitles;

title3 "Your title3 text goes here";

title4 "Your title4 text goes here";

%mend;

Use

Title2 "New title2 text";

%bottomtitles;

Or possibly slicker have IF TITLE2 is the only one that changes and changes often:

%macro MyTitles(title2);

Title1 "Title1 text";

title2 "&title2";

title3 "Your title3 text goes here";

title4 "Your title4 text goes here";

%mend;

Use:

%MyTitles(This is the first text for title2);

and later

%MyTitles(This is the later text for title2);

Ask a Question
Discussion stats
  • 2 replies
  • 210 views
  • 0 likes
  • 3 in conversation