%let name=margin; filename odsout '.'; data mydata; do i=1 to 100; y=round(ranuni(9)*100)/10; x=round(ranuni(8)*100)/10; /* for more 'interesting' data, bring x values in towards the center */ if x < 5 then x=x*2; else if x > 5 then x=x/1.5; output; end; run; data mydata; set mydata; length myhtml $500; myhtml='title='|| quote( 'X: '||trim(left(put(X,comma5.1)))||'0D'x|| 'Y: '||trim(left(put(Y,comma5.1)))||' ' ); run; proc sql; create table x_anno as select unique y from mydata; create table y_anno as select unique x from mydata; quit; run; /* Annotate some green line segments along the axis/border of the plot */ data x_anno; set x_anno; xsys='1'; /* % of data area */ ysys='2'; /* data-based */ when='a'; color='red'; function='move'; x=92; output; function='draw'; x=99; output; run; /* Do the 'flipside' along the other axis */ data y_anno; set y_anno; ysys='1'; /* % of data area */ xsys='2'; /* data-based */ when='a'; color='red'; function='move'; y=92; output; function='draw'; y=99; output; run; data myanno; set y_anno x_anno; run; /* data anno_colors; length function style color $10; retain xsys '3' ysys '3' when 'b' style 'solid'; orig_red= input('96',hex2.); orig_green=input('96',hex2.); orig_blue= input('96',hex2.); function='move'; x=50; y=50; output; do i=0 to 100 by 2; count+1; function='pie'; rotate=360; size=(i/2.4); percent=(count-1)/(60); red=orig_red + ( (256-orig_red) * percent ); if red > 255 then red=255; green=orig_green + ( (256-orig_green) * percent ); if green > 255 then green=255; blue=orig_blue + ( (256-orig_blue) * percent ); if blue > 255 then blue=255; rgb=put(red,hex2.)||put(green,hex2.)||put(blue,hex2.); color="cx"||rgb; output; end; proc sql; create table anno_colors as select * from anno_colors order by count descending; quit; run; */ /* Or, if you want the lightest color in the center */ data anno_colors; length function style color $10; retain xsys '3' ysys '3' when 'b' style 'solid'; orig_red= input('96',hex2.); orig_green=input('96',hex2.); orig_blue= input('96',hex2.); function='move'; x=50; y=50; output; do i=0 to 100 by 2; count+1; function='pie'; rotate=360; size=50-(i/2); percent=(count-1)/(23); red=orig_red + ( (256-orig_red) * percent ); if red > 255 then red=255; green=orig_green + ( (256-orig_green) * percent ); if green > 255 then green=255; blue=orig_blue + ( (256-orig_blue) * percent ); if blue > 255 then blue=255; rgb=put(red,hex2.)||put(green,hex2.)||put(blue,hex2.); color="cx"||rgb; output; end; run; /* */ /* Adjust x & y pixels so your graph is to the proportions you like */ /* goptions xpixels=500 ypixels=610; */ goptions ftitle="arial" ftext="arial" htitle=7pct htext=4pct; /* Make your axis go out 1 unit farther than it normally would, and make the final tickmark value be 'blank' so it doesn't show a number - this is the border/line-segment area. */ axis1 order=(0 to 11 by 1) minor=none value=(t=12 ' ') offset=(0,0); GOPTIONS DEVICE=gif; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" style=minimal; goptions noborder; symbol interpol=none color=red value=triangle h=.7; title h=7pct "Border Plot"; footnote h=5pct "Marginal Frequency Distribution Graph"; /* You can either use fake/blank titles on the left & right to 'squeeze' the propostions of the graph, or use something like xpixels & ypixels. */ title2 h=25pct a=90 " "; title3 h=25pct a=-90 " "; proc gplot data=mydata anno=myanno; plot y*x / haxis=axis1 vaxis=axis1 /* Put a reference line at next to last tickmark, to look like axis line */ href=10 vref=10 anno=anno_colors html=myhtml des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;