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
Rhodochrosite | Level 12

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
Rhodochrosite | Level 12

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
Rhodochrosite | Level 12

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!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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