I'm creating a VLine plot with Proc SgPlot, with 4 groups of data. Here is my code to create the plot. (I've genericized the variable names, of course.) This is wrapped in a macro, but I don't think that makes any difference.
proc sgplot data=mydata;
vline NominalTime / Response=responseVariable Group=MyGroups stat=mean markers;
format MyGroups MyGroups.;
Where scaleNum=&scaleNum;
run;
I'm using Proc Template to customize the line colors, LineStyles, and MarkerSymbols. The Template code is below:
proc template;
define style Styles.MyNewStyle;
parent = styles.HTMLBlue;
style GraphBackground /
backgroundcolor=white;
style GraphData1 from GraphData1 /
markersymbol = "circle"
color = CXFFB44B
contrastcolor = CXFFB44B
;
style GraphData2 from GraphData2 /
markersymbol = "circle"
color = white
contrastcolor=CX000000
;
style GraphData3 from GraphData3 /
markersymbol = "Square"
color = CXD33183
contrastcolor=CXD33183
;
style GraphData4 from GraphData4 /
markersymbol = 'Square'
linestyle = 2
color = white
contrastcolor=CX555555
;
style GraphFonts from GraphFonts /
'GraphDataFont' = ("Arial",11pt)
'GraphValueFont' = ("Arial",11pt)
'GraphLabelFont' = ("Arial",11pt,bold)
'GraphFootnoteFont' = ("Arial",8pt)
'GraphTitleFont' = ("Arial",12pt,bold);
end;
run;
Of course, I've used ods html to change the output style:
ods html style=MyNewStyle;
Here is the crux of the question: the plot is generated with the colors as specified, but with incorrect markersymbol and linestyle assignments for groups 2 to 4. Stated another way, whatever markersymbol and linestyle I specify in GraphData1 is used for all of the lines in the plot, regardless of later assignments. Why is this happening?
The key to understanding this behavior is that starting with SAS 9.3, the HTML destination uses the HTMLBlue style by default. This style is a "Color priority" style, where only the color is rotated first. There are 12 defined colors. So, the first 12 group values get one of these 12 colors, with the first marker symbol and line pattern. After the first 12 groups, the next 12 groups get the second marker symbol and line pattern, with the 12 colors again.
With HTMLBlue, the other markers and line patterns will only show up after the first 12 group values.
Most other styles have attribute priority of "None". This means the all three attributes are rotated at the same time. So first group value gets color 1, symbol 1, and pattern 1. Second group value gets color 2, symbol 2, and pattern 2 and so on.
With SAS 9.4, the option ATTRPRIORITY was introduced in the Style definition and on the ODS GRAPHICS statement to control this behavior. Now, you can use this option to make any style rotate the attributes the way you want. To make HTMLBlue behave like LISTING, use the ODS Graphics option ATTRPRIORITY=none.
This works as expected:
proc template;
define style Styles.MyNewStyle;
parent = styles.HTMLBlue;
style GraphBackground /
backgroundcolor=white;
style GraphData1 from GraphData1 /
markersymbol = "circle"
color = CXFFB44B
contrastcolor = CXFFB44B
;
style GraphData2 from GraphData2 /
markersymbol = "circle"
color = white
contrastcolor=CX000000
;
style GraphData3 from GraphData3 /
markersymbol = "Square"
color = CXD33183
contrastcolor=CXD33183
;
style GraphData4 from GraphData4 /
markersymbol = 'Square'
linestyle = 2
color = white
contrastcolor=CX555555
;
style GraphFonts from GraphFonts /
'GraphDataFont' = ("Arial",11pt)
'GraphValueFont' = ("Arial",11pt)
'GraphLabelFont' = ("Arial",11pt,bold)
'GraphFootnoteFont' = ("Arial",8pt)
'GraphTitleFont' = ("Arial",12pt,bold);
end;
run;
data mydata;
do mygroups = 1 to 4;
do nominaltime=1 to 20;
responsevariable = mygroups*nominaltime;
output;
end;
end;
run;
ods html style=mynewstyle;
proc sgplot data=mydata;
vline NominalTime / Response=responseVariable Group=MyGroups stat=mean markers;
* format MyGroups MyGroups.;
* Where scaleNum=&scaleNum;
run;
ods html close;
If that works on your system, then you have a problem with your MyGroups. format or values, I suspect. What values does MyGroups have natively - 1-4 or something else that MyGroups. format converts to 1-4?
If that doesn't work on your system, give more system details - 9.3, 9.2, etc.?
Related
I have downloaded this code from the web and I need to create a forest plot for each of the variables that have values as 'YES' and 'NO'. It works when each variable have different values however my data has same values for each of the variables. I tried several options but it is not working. Original code is downloaded from http://onsasprogramming.blogspot.com/2016/01/forest-plot-of-hazard-ratios-by-patient.html.
%let graphs='.';
%let dpi=100;
%let w=8in;
%let h=4.5in;
/*--Leading blanks in the subgroup variable must be non--blank spaces --*/
/*--Use character value 'A0', or copy from Windows System Character Map--*/
/*--Regular leading blanks will be stripped, losing the indentation --*/
data forest;
input Indent Subgroup $ HR LCL UCL ;
DATALINES;
0 Diabets . . .
2 YES 1.049419501 1.014598 1.085436
2 NO 1.149419501 1.114598 1.185436
0 OBESITY . . .
2 YES 1.000419048 0.979467 1.021819
2 NO 1.010419048 0.179467 1.121819
0 HTN . . . .
2 YES 0.790764015 0.737 0.988322
2 NO 0.790764015 0.637 0.988322
;
run;
/*--Replace '.' in subgroup with blank--*/
data forest2;
set forest;
subgroup=translate(subgroup, ' ', '.');
val=mod(_N_-1, 6);
indent=ifn(indent eq 2, 1, 0);
if val eq 1 or val eq 2 or val eq 3 then ref=subgroup;
run;
/*--Create font with smaller fonts for axis label, value and data--*/
proc template;
define style listingSF;
parent = Styles.Listing;
style GraphFonts from GraphFonts
"Fonts used in graph styles" /
'GraphDataFont' = (", ",7pt)
'GraphValueFont' = (", ",6pt)
'GraphLabelFont' = (", ",6pt, bold);
end;
run;
/*--Define templage for Forest Plot--*/
/*--Template uses a Layout Lattice of 6 columns--*/
proc template;
define statgraph Forest;
dynamic _show_bands _color _thk;
begingraph;
entrytitle 'Forest Plot of Hazard Ratios by Patient Subgroups ';
discreteattrmap name='text';
value '0' / textattrs=(weight=bold);
value other;
enddiscreteattrmap;
discreteattrvar attrvar=type var=indent attrmap='text';
layout lattice / columns=2 columnweights=(0.25 1.0);
/*--First Subgroup column, shows only the Y2 axis--*/
layout overlay / walldisplay=none xaxisopts=(display=none)
yaxisopts=(reverse=true display=none
tickvalueattrs=(weight=bold));
referenceline y=ref / lineattrs=(thickness=_thk color=_color);
axistable y=subgroup value=subgroup / indentweight=indent textgroup=type;
endlayout;
/*--Third column showing odds ratio graph--*/
layout overlay / xaxisopts=(TYPE=LOG label=' <---PCI Better---- ----Medical Therapy Better--->'
linearopts=(tickvaluepriority=true
tickvaluelist=(0.0 0.5 1.0 1.5 2.0 2.5)))
yaxisopts=(reverse=true display=none) walldisplay=none;
referenceline y=ref / lineattrs=(thickness=_thk color=_color);
scatterplot y=subgroup x=HR / xerrorlower=LCL xerrorupper=UCL
markerattrs=(symbol=squarefilled);
referenceline x=1;
endlayout;
endlayout;
entryfootnote halign=left textattrs=(size=7)
'The p-value is from the test statistic for testing the interaction between the '
'treatment and any subgroup variable';
entryfootnote halign=left 'This graph uses the new AXISTABLE plot to display the textual columns';
endgraph;
end;
run;
/*--Need format to show missing as blank--*/
proc format;
value misblank
. = ' ';
run;
/*----Create Graph-----*/
ods listing style=htmlblue gpath=&graphs image_dpi=&dpi;
ods graphics / reset noscale width=&w height=&h imagename='GTL_ForestPlot';
proc sgrender data=Forest2 template=Forest;
format pvalue group pcigroup misblank7.2;
dynamic _color='cxf0f0f0' _thk=12;
run;
The forest plot should give YES and NO under HTN and Obesity but it doesn't. Any tip would be appreciated.
I want to change the line (_____________) under the heading of the table to dotted line (---------) under the heading of the table in proc report step.
I tried using options formchar still its not working for me.
Can you please help me ? If data is required, i can send you in chat since the data is confidential
proc template;
%** Courier 9pt **;
define style Styles.ods_9pt;
parent=styles.rtf;
replace fonts/
'TitleFont2' = ("Courier New",9pt,Bold )
'TitleFont' = ("Courier New",9pt,Bold )
'FootnoteFont' = ("Courier New",9pt )
'StrongFont' = ("Courier New",9pt )
'EmphasisFont' = ("Courier New",9pt )
'FixedEmphasisFont' = ("Courier New",9pt )
'FixedStrongFont' = ("Courier New",9pt)
'FixedHeadingFont' = ("Courier New",9pt, Bold)
'BatchFixedFont' = ("Courier New",9pt,Bold )
'FixedFont' = ("Courier New",9pt )
'headingEmphasisFont' = ("Courier New",9pt,Bold )
'headingFont' = ("Courier New",9pt,Bold )
'docFont' = ("Courier New",9pt );
replace document from container /
asis = on
protectspecialchars=off;
replace SystemFooter from TitlesAndFooters /
asis = on
protectspecialchars = on
font= Fonts('FootnoteFont');
replace systemtitle from titlesandfooters/
asis = on
protectspecialchars=off;
replace body from document /
asis = on;
replace color_list
"Colors used in the default style" /
'link'= blue
'bgH'= white
'fg' = black
'bg' = white;
replace Table from output /
Background=_UNDEF_
cellpadding = 0pt
Rules=groups
Frame=void;
style Header from Header /
Background=_undef_;
style Rowheader from Rowheader /
Background=_undef_;
replace pageno from titlesandfooters/
Foreground=white;
end;
ods listing;
options papersize='LETTER' orientation=landscape topmargin = '3.61cm' bottommargin = '3.61cm'
leftmargin = '2.54cm' rightmargin = '2.54cm' nodate nonumber missing=.;
ods rtf file="/home/u000000/sasuser.v94/Listings/listing_Demo.rtf" style=styles.ods_9pt nogtitle nogfootnote;
ods escapechar = '~';
options formchar='|_---|+|---+=|-/\<>*'
options validvarname=any;
options pageno=1;
proc report data=newb nowd headline headskip split='*';
column num mypage TRT01A SITE BRTHDTC AGE SEX ETHNIC HEIGHTBL WEIGHTBL;
define num/ noprint;
*break after num/skip;
define mypage /order noprint;
break after mypage / page;
define TRT01A/'Treatment' order descending center style(column)={width=1in};
define SITE/'Site Id.*Unique Subject Id.' center style(column)={width=1in};
define BRTHDTC/'Date of*Birth' center style(column)={width=1in};
define AGE/'Age (YEARS)*[1]' center style(column)={width=1in};
define SEX/'Sex' center style(column)={width=1in};
define ETHNIC/'Ethnicity' center style(column)={width=1in};
define HEIGHTBL/'Height*(cm)' center style(column)={width=1in};
define WEIGHTBL/'Weight*(kg)'center style(column)={width=1in};
*compute after TRT01A;
*line '';
*endcomp;
title1 j=l height=10pt font="Courier New" "Protocol: XXX" ;
title3 j=l height=10pt font="Courier New" "Population :XXX" j=r 'Page ^{thispage} of ^{lastpage}';
title4;
title5 j=c height=10pt font="Courier New" "Listing";
title6 j=c height=10pt font="Courier New" "Listing of Demographic Characteristics";
title7;
footnote1 j = l height=10pt font="Courier New" "20NOV2020 10:42";
run;
ods rtf close;
ods listing;
#Reeza: can you help me with this?
Way 1
Add a line to the report.
ods rtf file='report.rtf' style=ods_9pt;
data class;
set sashelp.class;
page = 1;
run;
proc report data=class
style(header) = [BorderBottomStyle=hidden]
;
title;
where name < 'H';
columns page name age sex height weight;
define page / order noprint;
compute before page;
line '-----------------------------------------------------------';
endcomp;
run;
ods _all_ close;
Way 2
You can manipulate the report column headers by injecting destination specific characters.
You will also need to hide the header bottom border.
Example:
Change your style definition, replace
style Header from Header / Background=_undef_;
to
style Header from Header / Background=_undef_ borderbottomstyle=hidden;
and in the Proc REPORT, change the column headers to contain additional raw characters to be injected into the rtf table cell.
define TRT01A /
'Treatment*~{dest [RTF] ~{raw -------}}'
order descending center style(column)={width=1in};
Trick (LISTING)
There is an ODS LISTING trick for REPORT:
If a split line is two of the same formchar characters, they will be repeated across the column width.
* ODS listing only;
Proc REPORT ...;
...
define TRT01A /
'Treatment*--`
order descending center;
...
I have a table that is current laid out in the way I want. The only issue is that when I went to assign the format, it carried over the format for all values. I have a row that should be total, but I'm unsure how to strip the formatting on this row only in proc report:
Output
Want: total line to show no decimals as they are count but the rest of the table to keep same format.
%let gray=CXBFBFBF;
%let blue=CX13478C;
%let purple=CXDEDDED;
title j=c h=10pt f='Calibri' color=black "Table 1-Distribution, CY2016-CY2018";
options orientation = landscape nonumber nodate leftmargin=0.05in rightmargin=0.05in;
ods noproctitle noresults escapechar='^';
ods rtf file = "path.rtf";
proc report data= work.temp nowd spanrows style(report)={width=100%}
style(header)=[vjust=b font_face = Calibri fontsize=9pt font_weight=bold background=&blue. foreground=white borderrightcolor=black];
/*List variables in order to select order of columns in table*/
col ( m_type
('^S={borderbottomcolor=&blue. vjust=b borderbottomwidth=0.02 }'('^S={borderbottomcolor=&blue. vjust=b borderbottomwidth=0.01 cellheight=0.20in}Age in Years' d_char_desc))
('^S={cellheight=0.20in}Missing Information'
('^S={borderbottomcolor=&blue. borderbottomwidth=0.02 cellheight=0.18in}' percentage16_1)
('^S={borderbottomcolor=&blue. borderbottomwidth=0.02 cellheight=0.18in}' percentage17_1)
('^S={borderbottomcolor=&blue. borderbottomwidth=0.02 cellheight=0.18in}' percentage18_1))
);
define m_type /order=data group noprint style = [vjust=b just=left cellwidth=0.60in font_face='Times New Roman' fontsize=9pt];
define d_char_desc / order=data display style = [vjust=b just=left cellwidth=0.60in font_face='Times New Roman' fontsize=9pt]
'' style(header)=[vjust=b just=left cellheight=0.18in] style(column)=[vjust=b just=left cellheight=0.35in cellwidth=0.60in];
define percentage16_1 /display style = [vjust=b just=center cellwidth=0.60in cellheight=0.05in font_face='Times New Roman' fontsize=9pt]
'CY2016' style(header)=[vjust=b just=center cellheight=0.18in] style(column)=[vjust=b just=center cellheight=0.20in cellwidth=0.40in];
define percentage17_1 /display style = [vjust=b just=center cellwidth=0.45in cellheight=0.05in font_face='Times New Roman' fontsize=9pt]
'CY2017' style(header)=[vjust=b just=center cellheight=0.18in] style(column)=[vjust=b just=center cellheight=0.20in cellwidth=0.40in];
define percentage18_1 /display style = [vjust=b just=center cellwidth=0.45in cellheight=0.05in font_face='Times New Roman' fontsize=9pt]
'CY2018' style(header)=[vjust=b just=center cellheight=0.18in] style(column)=[vjust=b just=center cellheight=0.20in cellwidth=0.40in];
compute m_type;
if m_type = 'm_tot' then
call define (_row_, 'style', 'style=[fontweight=bold background=&gray. font_face=Times]');
endcomp;
run;
ods rtf close;
You will have to explicitly format the numeric values in respective compute blocks. The numeric value referenced will depend on the analysis statistic and the syntax will be variable.statistic.
Your data (not shown) appears to be some form of pre-computed aggregation, based on the m_type = 'm_tot' source code. In that case the reference would be something like percentage16_1.sum (sum is the default analysis for numeric variables when there is a grouping specified)
Example:
Summarize some SASHELP.CARS variables and change the format for the Ford make.
proc report data=sashelp.cars;
column (
make
horsepower mpg_city mpg_highway
horsepower_custom
mpg_city_custom
mpg_highway_custom
);
define make / group ;*noprint;
define horsepower / analysis noprint mean ;
define mpg_city / analysis noprint mean ;
define mpg_highway / analysis noprint mean ;
define horsepower_custom / computed style=[textalign=right];
define mpg_city_custom / computed style=[textalign=right];
define mpg_highway_custom / computed style=[textalign=right];
compute horsepower_custom / character length=10;
if make = 'Ford'
then horsepower_custom = put (horsepower.mean, 10.4);
else horsepower_custom = put (horsepower.mean, 8.1);
endcomp;
compute mpg_city_custom / character length=10;
if make = 'Ford'
then mpg_city_custom = put (mpg_city.mean, 10.5);
else mpg_city_custom = put (mpg_city.mean, 8.2);
endcomp;
compute mpg_highway_custom / character length=10;
if make = 'Ford'
then mpg_highway_custom = put (mpg_highway.mean, 10.6);
else mpg_highway_custom = put (mpg_highway.mean, 8.3);
endcomp;
run;
I am trying to make underscores (_) appear in my output while using ODS Tagsets but for some unknown reasons it's not appearing as expected. I'm using SAS 9.4.
It appears with Bodytitle and Bodytitle_aux but the pagebreaking is much better with Tagsets.
Unfortunately using unicode doesn't work either.
Here is a sample code:
options nonumber;
%let path=;
ods path(prepend) work.templat(update);
proc template ;
define style newstyle ;
parent = styles.journal ;
class Parskip /
font = fonts("headingFont")
cellpadding = 0 cellspacing = 0 /* Only for Measured */
frame= void
Rules = NONE
BorderWidth = 0
Color = _undef_
BackGroundColor = _undef_;
style byline / font_face="Courier New" font_style=Roman background = white;
style Body from Document / font_face="Courier New" font_style=Roman background = white;
style data / font_face="Courier New" font_style=Roman ;
style table / font_face="Courier New" font_style=Roman
bordercolor=black background = white borderwidth=1 ;
style cellcontents / font_face="Courier New" font_style=Roman ;
style TitleAndNoteContainer / font_face="Courier New" font_style=Roman background = white;
style ProcTitle / font_face="Courier New" font_style=Roman ;
style systemtitle / font_face="Courier New" font_style=Roman ;
style rowheader from headersandfooters / font_face="Courier New" font_style=Roman ;
style BodyDate / font_face="Courier New" font_style=Roman ;
style PageNo / font_face="Courier New" font_style=Roman ;
style SysTitleAndFooterContainer / font_face="Courier New" font_style=Roman ;
style header from headersandfooters / font_face="Courier New" font_style=Roman background = white;
style SystemFooter / font_face="Courier New" font_style=Roman bordercolor=black background = white borderwidth=1 ;
style NoteContent / font_face="Courier New" font_style=Roman font_size=8pt;
end;
run ;
options papersize=letter leftmargin=3.65cm rightmargin=2.11cm topmargin=3.36cm bottommargin=3.3cm orientation=landscape;
ods escapechar="^";
ods tagsets.rtf file="&path.\shoes2file.rtf" options(vspace='no') options(continue_tag="no");
ods tagsets.rtf style=newstyle ;
title1 'Title: Shoes';
proc report data=sashelp.shoes(obs=10) nowd style(header)=[rules=group frame=above background=white font_size=8pt]
style(report)=[outputwidth=100% rules=group frame=hsides background=white font_size=8pt ]
style(column)=[rules=group font_size=8pt] spanrows;
column region product;
define region / '___Region___' display style(column)=[width=1.5cm asis=on just=l] style(hdr)=[asis=on just=l];
define product / '___Product___' display style(column)=[width=1.5cm asis=on just=l] style(hdr)=[asis=on just=l];
footnote 'Footnote Page L____4';
run;
ods tagsets.rtf close;
options nonumber
nocenter nobyline nodate formdlim=''
formchar="|_---|+|---+=|-/\<>*" MISSING=" " ;
In the attached photo, the highlighted circles are the places where underscores are supposed to be. Any help is appreciated.
The problem is that in Courier font (really Courier New) the underscore is below even the tail of the normal characters (which makes it really useful for underlining by "overstriking").
I am not sure how to fix the style to do it but I was able to get it to show the underscores by changing the spacing after the "paragraphs" from 0 point to 1 points. Here is data step that replaces all \sa0 commands in your RTF file with \sa20. The resulting file shows the underscores.
data _null_;
infile "&path/shoes2file.rtf";
file "&path/shoes2file_fixed.rtf";
input;
_infile_ = tranwrd(_infile_,'\sa0','\sa20');
put _infile_;
run;
I am trying to produce a graph with multiple groupings. The sample data code is:
proc sort data=sashelp.cars out=cars;
by DriveTrain;
where n(Cylinders);
run;
I used dattrmap to add distinct colors to the different groups as follow:
data MyAttrMap;
length MARKERCOLOR CONTRASTCOLOR color $25;
ID='myreg'; value='All' ; MARKERCOLOR='red'; color='red'; MARKERSYMBOL = 'circle'; output;
ID='myreg'; value='Front'; MARKERCOLOR='blue'; color='blue'; MARKERSYMBOL = 'circle'; output;
ID='myreg1'; value='USA'; CONTRASTCOLOR='yellow'; color='yellow'; output;
ID='myreg1'; value='Europe'; CONTRASTCOLOR='black'; color='black'; output;
ID='myreg1'; value='Asia'; CONTRASTCOLOR='green'; color='green'; > > output;
run;
proc sgplot data=work.cars
dattrmap=MyAttrMap;
hbarparm category=enginesize response=horsepower/group=DriveTrain barwidth=.5 attrid=myreg name='dt';
scatter X=MPG_City Y=enginesize /group=origin name='origin' attrid=myreg1;
keylegend 'dt' / title='Drive Train' location=outside position=bottom;
keylegend 'origin' / title='Origin' location=outside position=bottom;
where DriveTrain in ('All' 'Front');
run;
The Attrmap was created with the intention of having different colors for Origin and DriveTrain however, when the output is created the same colors applied to Origin are applied to DriveTrain.
I also tried using Proc template to change the style as follow:
/*Different colors from the ones used above*/
proc template;
define style MyStyle;
parent = Styles.Listing;
STYLE graphdata1 /
MARKERSYMBOL = 'circle'
LINESTYLE = 1
CONTRASTCOLOR = liypk
COLOR = red
;
STYLE graphdata2 /
MARKERSYMBOL = 'circle'
LINESTYLE = 1
CONTRASTCOLOR = stybr
COLOR = yellow
;
STYLE graphdata3 /
MARKERSYMBOL = 'circle'
LINESTYLE = 1
CONTRASTCOLOR = mog
COLOR = green
;
STYLE graphdata4 /
MARKERSYMBOL = 'circle'
LINESTYLE = 1
CONTRASTCOLOR = brown
COLOR = pink
;
STYLE graphdata5 /
MARKERSYMBOL = 'circle'
LINESTYLE = 1
CONTRASTCOLOR = black
COLOR = grey
;
end;
run;
But still the same results were obtained. Could anyone please tell me what I'm doing wrong or how to get this to work? I'm using SAS 9.3.
Another issue I'm encountering is the sorting. I want to sort the bars so that the same origins appear together and by the horsepower. I sorted using sortkey=national and used grouporder=data as recommended by SAS but this didn't change the ordering in the output. Any help is appreciated.
.
Thanks.
You might find SGPANEL a better option for visually presenting the distributions of different groups.
ods html style=normal;
ods graphics / height=900px;
proc sgpanel data=sashelp.cars;
panelby origin
/ columns=3
;
hbar enginesize
/ group=drivetrain
groupdisplay=cluster
;
where
DriveTrain in ('Front', 'All')
and not missing(cylinders)
;
run;
Check your attribute map data set. Because you haven't specified the lengths for the Value and ID column they're truncated and don't match your data so they don't get assigned correctly.
Simplifying your problem, I assigned all the elements for testing:
I also assumed this was mocked up because of the errors in the log.
proc sort data=sashelp.cars out=cars;
by DriveTrain;
where n(Cylinders);
run;
data MyAttrMap;
length ID $10. linecolor MARKERCOLOR CONTRASTCOLOR fillcolor color value $25;
ID='myreg1';
value='USA';
contrastcolor='cxaf8dc3';
LINECOLOR='cxaf8dc3';
MARKERCOLOR='cxaf8dc3';
fillcolor='cxaf8dc3';
output;
ID='myreg1';
value='Europe';
contrastcolor='cx7fbf7b';
LINECOLOR='cx7fbf7b';
MARKERCOLOR='cx7fbf7b';
fillcolor='cx7fbf7b';
output;
ID='myreg1';
value='Asia';
contrastcolor='cx91bfdb';
LINECOLOR='cxfc8d59';
MARKERCOLOR='cxfc8d59';
fillcolor='cxfc8d59';
output;
run;
ods graphics / attrpriority=none;
proc sgplot data=work.cars dattrmap=MyAttrMap;
scatter X=MPG_City Y=enginesize /group=origin name='origin' attrid=myreg1;
where DriveTrain in ('All' 'Front');
run;