BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
data_null__
Jade | Level 19

Is there a way to get the Y axis label in the top figure to move closer to the tick labels.  I get why it is positioned this way because of the tick values in the bottom figure.  I'm using GTL.

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

John.King ,

That would be better if you could post some data and your GTL code to test your problem.

Here I make some dummy code to give you some help.

 

 

%sganno
data sganno;
 %SGTEXT(LABEL="Monophasic (11pts)",WIDTH=40,DRAWSPACE="LAYOUTPERCENT",ID="BAR",ROTATE=90,X1=15,Y1=30)
run;


proc template;
define statgraph y2axis;
begingraph;
layout lattice / rows=2 rowgutter=10
rowdatarange=union row2datarange=union;


layout overlay /  yaxisopts=( label=" " )  ;
histogram height / scale=count ;
histogram height / scale=percent;
densityplot height / normal();
annotate / id="BAR";
endlayout;

layout overlay /  yaxisopts=( label=" " )  ;
scatterplot y=smoking_Status x=weight;
endlayout;

endlayout;
endgraph;
end;
proc sgrender data=sashelp.heart template=y2axis sganno=sganno;
run;

Ksharp_0-1738549074745.png

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

Look at annotation to place text at arbitrary locations. Start here for some details: https://documentation.sas.com/doc/en/pgmsascdc/v_057/grstatgraph/p0rgjcddtqwpyin1ro3kvrksd6js.htm

 

Without data and complete template code I wouldn't even make an attempt at some other work around as there are just too many moving parts with GTL to have a chance of getting a working alternative.

Ksharp
Super User

John.King ,

That would be better if you could post some data and your GTL code to test your problem.

Here I make some dummy code to give you some help.

 

 

%sganno
data sganno;
 %SGTEXT(LABEL="Monophasic (11pts)",WIDTH=40,DRAWSPACE="LAYOUTPERCENT",ID="BAR",ROTATE=90,X1=15,Y1=30)
run;


proc template;
define statgraph y2axis;
begingraph;
layout lattice / rows=2 rowgutter=10
rowdatarange=union row2datarange=union;


layout overlay /  yaxisopts=( label=" " )  ;
histogram height / scale=count ;
histogram height / scale=percent;
densityplot height / normal();
annotate / id="BAR";
endlayout;

layout overlay /  yaxisopts=( label=" " )  ;
scatterplot y=smoking_Status x=weight;
endlayout;

endlayout;
endgraph;
end;
proc sgrender data=sashelp.heart template=y2axis sganno=sganno;
run;

Ksharp_0-1738549074745.png

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 876 views
  • 0 likes
  • 3 in conversation