Data visualization with SAS programming

How to make rounded corners for graph border?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

How to make rounded corners for graph border?

I need to create a dot plot with border and the border must have rounded corners instead of regular corners. Could someone please help me with it? Thanks.

Here is my code:


PROC SGPLOT DATA = temp1 dattrmap=attrmap border;

Scatter Y=NAME X = MY1R/markerAttrs=(COLOR=purple size=6MM symbol=CIRCLEFILLED) datalabel=MY1R DATALABELATTRS=(size=9pt weight=bold COLOR=White) DATALABELPOS=CENTER transparency=0.1;

Scatter Y=NAME X = MY2R/markerAttrs=(COLOR=purple size=6MM symbol=CIRCLEFILLED) datalabel=MY2R DATALABELATTRS=(size=9pt weight=bold COLOR=White) DATALABELPOS=CENTER transparency=0.1;


XAXIS DISPLAY=(NOTICKS) label=' ';
YAXIS DISPLAY=(NOTICKS noline) LABEL = ' ' labelattrs=(color=White) valueattrs=(size=12pt Family=Arial color=black) GRID gridattrs=(color=WhiteSmoke) MINORGRIDATTRS=(color=green pattern=longdash thickness=2);

run;


Accepted Solutions
Solution
‎01-09-2018 09:36 AM
SAS Super FREQ
Posts: 496

Re: How to make rounded corners for graph border?

Posted in reply to hanyi0221

Oh.  That makes more sense.  It is almost the same.

data anno;
  drawspace = 'GraphPercent';
  function  = 'Rectangle';
  cornerradius=0.1;
  linestyleelement='GraphAxisLines';
  retain x1 y1 50  height width 100 heightunit widthunit 'Percent';
run;

ods graphics on / noborder;
proc sgplot data=sashelp.class sganno=anno;
   reg y=weight x=height / group=sex;
run;

proc print; run;

View solution in original post


All Replies
SAS Super FREQ
Posts: 496

Re: How to make rounded corners for graph border?

Posted in reply to hanyi0221

What comes to mind is suppressing the border and redrawing it by using SG annotation.

data anno;
  drawspace = 'WallPercent';
  function  = 'Rectangle';
  cornerradius=0.1;
  linestyleelement='GraphAxisLines';
  retain x1 y1 50  height width 100 heightunit widthunit 'Percent';
run;

ods html body='b.html';
proc sgplot data=sashelp.class sganno=anno noborder;
   reg y=weight x=height / group=sex;
   xaxis display=(noline);
   yaxis display=(noline);
run;
ods html close;

proc print; run;
Occasional Contributor
Posts: 16

Re: How to make rounded corners for graph border?

Posted in reply to WarrenKuhfeld

Hi Warren,

Thanks for your reply, but this method rounded the corners of the inside border (I do not need any border for it), I would like to round the corners for the outside border (the yellow highlighted line in the pic). 

Solution
‎01-09-2018 09:36 AM
SAS Super FREQ
Posts: 496

Re: How to make rounded corners for graph border?

Posted in reply to hanyi0221

Oh.  That makes more sense.  It is almost the same.

data anno;
  drawspace = 'GraphPercent';
  function  = 'Rectangle';
  cornerradius=0.1;
  linestyleelement='GraphAxisLines';
  retain x1 y1 50  height width 100 heightunit widthunit 'Percent';
run;

ods graphics on / noborder;
proc sgplot data=sashelp.class sganno=anno;
   reg y=weight x=height / group=sex;
run;

proc print; run;
Occasional Contributor
Posts: 16

Re: How to make rounded corners for graph border?

Posted in reply to WarrenKuhfeld

Thank you! It works!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 212 views
  • 2 likes
  • 2 in conversation