-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Shane Rosanbalm edited this page Mar 10, 2017
·
12 revisions
The simplest application of the %viridis()
macro requires only one parameter: n=
.
%viridis(n=4)
The result of this call will be a macro variable &viridis4
which contains a space-separated list of colors from the viridis palette.
viridis4 = cx440154 cx30688E cx35B779 cxFEE724
If you're using SAS v9.2 you'll use &viridis4
in the colors=
parameter of the %modstyle()
macro. If you're using SAS v9.3 or higher you can use &viridis4
in the datacontrastcolors=
argument of the styleattrs
statement.
%viridis(n=4);
proc sgplot;
styleattrs datacontrastcolors=(&viridis4);
series ...
run;
The macro can also be used for color response plots. For instance, with the colormodel=
argument on the heatmap
statement.
%viridis
(n=256
,palette=plasma
,result=myramp
);
proc sgplot data=plotdata;
heatmap x=x y=y / colormodel=(&myramp);
run;
Pretty, oh so pretty!