Curious that Proc SGPanel has such limited Inset offerings. Hmmm.
So, have to stick with Proc Univariate. Seems "Height" (of Text) doesn't work.
Probably need some SAS Graph Template Language magic, if it can be done at all.
Again, increase text size (and, of course, corresponding holding box) in the Inset.
Suggestions greatly appreciated.
Nicholas Kormanik
Hello, it is possible to use SGPLOT, SGPANEL or GTL to increase the text size within a histogram. Can you please give an example of the text that you like to increase, and do you have example code?
Thanks,
Kriss
Been searching out there, and, yes, appears that SGPANEL may be the best option to get a larger inset. Specifically, here's someone that seems to have done it:
Quite convoluted, though.
Attached is data file and code. Any and all suggestions greatly appreciated.
Nicholas Kormanik
If you want to have bigger text in the box which shows the statistics, then you can simply do this with the TEXTATTRS option.
Please see below how I've use the TEXTATTRS option to make the font be in Green and style italic, and with larger text.
proc univariate data=sashelp.class noprint;
var height;
output out=sum n=n mean=mean median=med std=sd;
run;
data _null_; set sum;
call symputx("n",n);
call symputx("mean",put(round(mean,.01),8.2));
call symputx("med",put(round(med,.01),8.2));
call symputx("sd",put(round(sd,.01),8.2));
run;
proc sgplot data=sashelp.class;
histogram height/fillattrs=(color=v0dc10f5);
density height/type=normal lineattrs=(thickness=0.5) name="a";
density height/type=kernel lineattrs=(thickness=0.5) name="b";
keylegend "a" "b"/title="曲線" location=outside position=bottom;
inset "N : &n." "Mean : &mean." "Median : &med." "SD : &sd."/
title="Statistics" border position=topleft labelalign=center valuealign=left TEXTATTRS=(Color=Green Family=Arial Size=12 Style=Italic Weight=Bold);
run;
Many thanks,
Kriss
Thanks for the lead, djrisks. Still trying to figure it all out.
Part of the issue is the contents of the Inset. Each item has to be newly created, apparently, to use in SGPanel. Too, SGPanel is a little different from SGPlot (the example you provided).
Wish I could continue to use Proc Univariate, and simply increase text size in the Inset. That would by far be the easiest approach.
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.
Ready to level-up your skills? Choose your own adventure.