BookmarkSubscribeRSS Feed
DinoPut
Obsidian | Level 7

Hi

 

I have been trying to create a figure with a table to the bottom. I was successful in generating the figure with a table, however there appears to be a Y-axis label corresponding to the numbers in the table. How can I remove the Y-axis label?

 

Thanks in advance

 

Below is my program:

 

proc template;
define statgraph line;

begingraph / designwidth=6.5 in designheight=4.33in ;
entrytitle ' ';
layout lattice /columndatarange=union rowweights=(1);
*--------------------------------------------------------------------*
| Line Plot
*--------------------------------------------------------------------*;


layout overlay / yaxisopts=(label="&ylabel" linearopts=(viewmin=&ymin viewmax=&ymax tickvaluelist=(&yvals)))
xaxisopts=( label="&xlabel" offsetmin=0.01 offsetmax=0.01
linearopts=(viewmin=&xmin viewmax=&xamax /*tickvaluelist=(&xvals)*/ tickvaluesequence=(start=&xmin end=&xend increment=&xint)));

scatterplot x=&xvar y=&stat/ group=treat name='treat' markerattrs=(size=5pt);
seriesplot x=&xvar y=&stat /group=treat lineattrs=(thickness=1 pattern=1);

***********present n for each timepoint in the figure****;

innermargin / align=bottom opaque=true backgroundcolor=white;
axistable x=&xvar value=bign / headerlabel="n*" display=(label)
headerlabelattrs=(size=6pt weight=normal) valueattrs=(size=6pt weight=normal) labelattrs=(size=6pt weight=normal color=white)
colorgroup=&trt class=&trt classdisplay=cluster gutter=5px;
endinnermargin;

******Add n done;

discretelegend 'treat' / location=outside halign=left valign=bottom
order=rowmajor border=false valueattrs=(size=7pt);

endlayout;
endlayout;

endgraph;
end;
run;

5 REPLIES 5
ballardw
Super User

@DinoPut wrote:

Hi

 

I have been trying to create a figure with a table to the bottom. I was successful in generating the figure with a table, however there appears to be a Y-axis label corresponding to the numbers in the table. How can I remove the Y-axis label?

With only a picture what exact value are objecting to? It is not clear from your description.

 

I would suggest providing

1) a small example data set that shows the problem behavior with the code

2) code with definitions of all of the macro variables

3) the Sgrender used to create the output.

 

Then we can test what is going on.

 

I am a little concerned that elements in the template, such as the legend, do not appear in your output image.

DinoPut
Obsidian | Level 7

Sure Ballardw! I have attached an xls sheet with the data and a new plot with the legends. I have also highlighted the Y-labels in yellow (those are the ones I would like to remove). Below is the program along with sgrender:

 

proc template;
define statgraph line;

begingraph / designwidth=6.5 in designheight=4.33in ;
entrytitle ' ';
layout lattice /columndatarange=union rowweights=(1);
*--------------------------------------------------------------------*
| Line Plot
*--------------------------------------------------------------------*;


layout overlay / yaxisopts=(label="Value" linearopts=(viewmin=0 viewmax=160 tickvaluelist=(0 40 80 120 160)))
xaxisopts=( label="Time (Weeks)" offsetmin=0.01 offsetmax=0.01
linearopts=(viewmin=0 viewmax=76 tickvaluesequence=(start=0 end=76 increment=4)));

scatterplot x=trt01a y=aval/ group=treat name='treat' markerattrs=(size=5pt);
seriesplot x=trt01a y=aval /group=treat lineattrs=(thickness=1 pattern=1);

***********present n for each timepoint in the figure****;

innermargin / align=bottom opaque=true backgroundcolor=white;
axistable x=trt01a value=bign / headerlabel="n*" display=(label)
headerlabelattrs=(size=6pt weight=normal) valueattrs=(size=6pt weight=normal) labelattrs=(size=6pt weight=normal color=white)
colorgroup=trt01a class=trt01a classdisplay=cluster gutter=5px;
endinnermargin;

******Add n done;

discretelegend 'treat' / location=outside halign=left valign=bottom
order=rowmajor border=false valueattrs=(size=7pt);

endlayout;
endlayout;

endgraph;
end;
run;

proc sgrender data=final template=line ;
run;

DinoPut
Obsidian | Level 7

In case this file was not attached previously

ballardw
Super User

@DinoPut wrote:

In case this file was not attached previously


The A and B highlighted in yellow have nothing to do with Y axis. They are the values of the CLASS variable in your AXISTABLE options.

I'm not sure if there is any way to turn them off and if you have two rows of values for the Axistable I would expect that you want to what each row represents.

 

 

The text in the first example document could be either different Class variable or a format applied to the Class variable.

 

 

DinoPut
Obsidian | Level 7

Thank you, ballardw. I am aware of the fact that they have nothing to do with Y-axis. But they are values of the class statement displayed as the Y-label and I would not want them displayed since it is redundant information with the legend. Color coding is already available to specify which group the values belong to. The other issues is when the values are too long to be displayed on the Y-axis. To avoid such situations, I wanted to remove values of the class statement displayed as the Y-label.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 5 replies
  • 1629 views
  • 0 likes
  • 2 in conversation