Hi
I've made the following scatterplot with sgplot and would like to add background colors, so that:
Is there a way of doing this in proc sgplot (I have attached my data as a xlsx-file)?
Graph:
Code:
title "Lovoverholdelsesprocenter over tid - §50-Undersøgelser";
proc sgplot data=graf dattrmap=attrmap_bu noborder ;
where sagstrin ? "2" and 'Med i Baselin'n ne '';
scatter x=pct_118 y=diff / group=spg attrid=spg;
styleattrs datacolors=(red yellow green);
xaxis min=-0 max=1 values=(0 to 1 by 0.1) fitpolicy=rotate valuesrotate=diagonal valueattrs=(Family=Helvetica Size=8) label="Lovoverholdelse 1. kvt./18";
yaxis min=-0.4 max=0.5 values=(-0.4 to 0.5 by 0.1) valueattrs=(Family=Helvetica Size=8) label="Frem-/tilbagegang ift. 4/17 i procentpoint";
refline 0 /axis=y;
refline 0.75 /axis=x;
*keylegend "underniv" / across=3 noborder valueattrs=(Family=Helvetica Size=7);
run;
If you know the data extents, use POLYGON plot to display the 4 regions you want.
If you know the data extents, use POLYGON plot to display the 4 regions you want.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.