I have a program that prepares a map
proc gmap map=mappaRMV data=tblTOT all; id pro_com__t; choro percent / COUTLINE=green levels=5 ; format percent 6.2 ; run;
The coloring of the areas is done in shades of blue (Enterprise guide)
If I direct the output with ODS PDF and SAS 9.04.01M8 for Windows I get
While if I direct the output with ODS PDF and same SAS 9.4 for Linux I get
The sas code is EXACTLY THE SAME
Hi @AndreaVianello, SAS uses different styles depending on the destination. For complete control with PROG GMAP, I suggest you create a style yourself to control the colour gradient. Here is an example:
/* DEFINE STYLE */
%let color1=vligb; /*very light greenish blue */
%let color2=vigb; /*vivid greenish blue*/
proc template;
define style styles.grad1;
parent=styles.listing;
style twocolorramp / startcolor=&color1 endcolor=&color2;
end;
run;
You can then use this style in your ODS statements:
ods pdf file="..../choro.pdf" style=grad1;
proc gmap map=toronto data=pop all;
id cfsauid;
choro pop / COUTLINE=green levels=5 ;
format pop 6.2 ;
run;
ods pdf close;
This is the resulting choropleth map:
Hi @AndreaVianello, SAS uses different styles depending on the destination. For complete control with PROG GMAP, I suggest you create a style yourself to control the colour gradient. Here is an example:
/* DEFINE STYLE */
%let color1=vligb; /*very light greenish blue */
%let color2=vigb; /*vivid greenish blue*/
proc template;
define style styles.grad1;
parent=styles.listing;
style twocolorramp / startcolor=&color1 endcolor=&color2;
end;
run;
You can then use this style in your ODS statements:
ods pdf file="..../choro.pdf" style=grad1;
proc gmap map=toronto data=pop all;
id cfsauid;
choro pop / COUTLINE=green levels=5 ;
format pop 6.2 ;
run;
ods pdf close;
This is the resulting choropleth map:
Thanks everyone for your help. I was wrong to think the problem was in the proc gmap when it was actually in the ods pdf style.
I also learned how to define a style!
I'll definitely also look into the new features of the proc SGmap .
Hello,
Why don't you use PROC SGMAP (instead of proc gmap)?
The prefix SG is for Statistical Graphics.
See here:
New SGmap features in SAS 9.4m7
By Robert Allison on Graphically Speaking
https://blogs.sas.com/content/graphicallyspeaking/2020/09/25/new-sgmap-features-in-sas-9-4m7/
Ciao,
Koen
If you like the appearance that EG gives you then the steps are
1) determine the current ODS STYLE in effect for your session (might be HTMLBlue)
2) on the code that defines the PDF file add the STYLE= option to use the same style. Or if using the EG interface to set the PDF file options there should be a STYLE option somewhere.
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.