BookmarkSubscribeRSS Feed
mounikag
Obsidian | Level 7

Hi Team,

 

In figure 1 , i want to remove extra space(highlighted in blue) below the total subjects . Iam fixing with padding option but its not working. Is there any option available to remove extra space?

In figure 2, Line is getting stripped off after colaxistable which is highlighted in yellow . I want the line to represent same as figure 1 line as a panel line for each treatment. How to fix to get the line back?

Here is the code iam using  :

CODE:

 


proc sgpanel data=chk ;
by rowlbl;
panelby tptn / layout=columnlattice
onepanel noborder novarname
colheaderpos=bottom headerattrs=(size=7.5) spacing=10;
format tptn tptf.;

vbarbasic trtn / response=percent group=grade barwidth=1.0;
format trtn trt2f.;
colaxistable tot/NOMISSINGCHAR class=class_var pad=(bottom=10px);

colaxis display=(nolabel);
rowaxis values=(0 to 100 by 10) label='Percentage of Subjects with Reactions' ;
run;

FIgure1:

Inkedimg1_LI.jpg

Figure 2:

 

Cap2.PNG

 

Thanks,

Mounika

2 REPLIES 2
ballardw
Super User

Data sure would be nice so we can test code.

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

If you are using custom formats with any of the variables then definition code for the formats also.

 

Your graphics settings from ODS Graphics may be needed. My size for a graph might "work" but not with your settings or image types.

 

The actual ODS Style in effect may be needed as that effects things like line appearance plus the ODS destination, the SAS results window, PDF, RTF, or other destination.

 

And sometimes it may be time to consider the Graphic Template Language, which takes some learning but provides more low-level tools to control things.(Go the Results tab to see the graphs in these examples, each has data and code to build the graph, often with options you may not want [yet] )

This shows a different approach to side by side groups of bars with similar subgroups: https://support.sas.com/kb/49/695.html 

or different subgroups https://support.sas.com/kb/39/166.html

 

 

Ksharp
Super User

As said @ballardw  ,post some data ,so we can test your code and replicate your problem.

Without data ,I would not to waste my time to give a try.

 

data have;
 set sashelp.heart;
run;

proc sql;
create table final as
select bp_status,sex,status,count(*) as weight
 from have
  group by bp_status,sex,status;
quit;
data final;
 set final end=last;
 by bp_status sex ;
 class_var='Total Subject';
 if first.sex then do;
   if sex='Female' then tot=120;
    else tot=80;
 end;
run;



Option missing=' ';
proc sgpanel data=final ;
panelby bp_status / layout=columnlattice
onepanel noborder novarname
colheaderpos=bottom headerattrs=(size=7.5) spacing=10;

vbarbasic sex / response=weight group=status barwidth=1.0;
colaxistable tot/class=class_var;

colaxis display=(nolabel);
rowaxis  label='Percentage of Subjects with Reactions' ;
run;

Ksharp_0-1643290459607.png

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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