BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hanyi0221
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Ammonite | Level 13

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

4 REPLIES 4
WarrenKuhfeld
Ammonite | Level 13

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;
hanyi0221
Fluorite | Level 6

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). 

WarrenKuhfeld
Ammonite | Level 13

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;
hanyi0221
Fluorite | Level 6

Thank you! It works!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 4 replies
  • 2736 views
  • 2 likes
  • 2 in conversation