BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dcortell
Pyrite | Level 9

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

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
dcortell
Pyrite | Level 9

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;

View solution in original post

1 REPLY 1
dcortell
Pyrite | Level 9

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 758 views
  • 0 likes
  • 1 in conversation