Hi all
With the following code:
ods listing style=htmlblue;
ods graphics / width=10in height=5in;
ods text="^S={fontweight=bold fontsize=15pt} Interaction Index drivers: Efficency vs Efficacy Cy vs Py";
proc sgplot data=inter_tot noautolegend;
bubble x=Yoy_NInter y=Yoy_NSourced size=Sourced_Vol2020 / group=countryname datalabel=countryname
transparency=0.4 datalabelattrs=(size=9 weight=bold);
xaxis grid min=-1 max=1 values=(-1 to 1 ) ;
yaxis grid min=-1 max=1 values=(-1 to 1 ) ;
REFLINE 0 / axis=x;
REFLINE 0 / axis=y;
refline -0.15 / axis=y lineattrs=(color=green thickness=3px
pattern=ShortDashDot);
lineparm x=0 y=0 slope=1; /** intercept, slope **/
inset "Inefficency and Inefficacy" / position=bottomright textattrs=(size=11);
inset "Inefficency Producers" / position=topright textattrs=(size=11);
inset "Efficacy & efficency" / position=topleft textattrs=(size=11);
inset "Decrease with efficency" / position=bottomleft textattrs=(size=11);
run;
ods text="Bubble size represents Sourced Vol.";
ods pdf startpage=now;
I get weird results in terms of the derived bubble chart matrix:
- first case X-axis alignment went totally off
- second case all the instances are not included in the chart
dcortell_0-1588006569881.png
dcortell_1-1588006588111.png
this the table behind:
dcortell_2-1588006799574.png
dcortell_3-1588006833548.png
dcortell_4-1588006850657.png
Any suggestion about this weird behavior?
Bests
Solved adding the offset options to the x-axis line of code:
proc sgplot data=drivers&&mkt_nC&i noautolegend;
bubble x=YoyInt y=YoyOpp size=Sourced_Vol / group=inter_yy datalabel=inter_yy
transparency=0.4 datalabelattrs=(size=9 weight=bold);
xaxis grid min=-1 max=1 values=(-1 to 1 ) OFFSETMAX=0 OFFSETMIN=0 ;
yaxis grid min=-1 max=1 values=(-1 to 1 ) OFFSETMAX=0 OFFSETMIN=0 ;
REFLINE 0 / axis=x;
REFLINE 0 / axis=y;
refline -0.15 / axis=y lineattrs=(color=green thickness=3px
pattern=ShortDashDot);
lineparm x=0 y=0 slope=1; /** intercept, slope **/
inset "Inefficency and Inefficacy" / position=bottomright textattrs=(size=11);
inset "Inefficency Producers" / position=topright textattrs=(size=11);
inset "Efficacy & efficency" / position=topleft textattrs=(size=11);
inset "Decrease with efficency" / position=bottomleft textattrs=(size=11);
run;
Solved adding the offset options to the x-axis line of code:
proc sgplot data=drivers&&mkt_nC&i noautolegend;
bubble x=YoyInt y=YoyOpp size=Sourced_Vol / group=inter_yy datalabel=inter_yy
transparency=0.4 datalabelattrs=(size=9 weight=bold);
xaxis grid min=-1 max=1 values=(-1 to 1 ) OFFSETMAX=0 OFFSETMIN=0 ;
yaxis grid min=-1 max=1 values=(-1 to 1 ) OFFSETMAX=0 OFFSETMIN=0 ;
REFLINE 0 / axis=x;
REFLINE 0 / axis=y;
refline -0.15 / axis=y lineattrs=(color=green thickness=3px
pattern=ShortDashDot);
lineparm x=0 y=0 slope=1; /** intercept, slope **/
inset "Inefficency and Inefficacy" / position=bottomright textattrs=(size=11);
inset "Inefficency Producers" / position=topright textattrs=(size=11);
inset "Efficacy & efficency" / position=topleft textattrs=(size=11);
inset "Decrease with efficency" / position=bottomleft textattrs=(size=11);
run;
CFC_SAS_Communities_400x225.jpg
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.
Ready to level-up your skills? Choose your own adventure.