BookmarkSubscribeRSS Feed
acordes
Rhodochrosite | Level 12

When I use the sgplot procedure in sas viya and get a lot of graphs generated due to a "by" statement for example, the output will open in a new browser tab.

That's convenient because I can save as a html page by right-click. This preserves mouseover feature and so on. 

 

But when I have few graphs output, they are displayed within the sas studio window and the option to save as html vanishes. I can only save each individual plot but it's not tip-able anymore. 

 

How can I force ods to output always in a new brower tab?

 

I attach the code of sgplot without data. I suppose a response here does not require a working example. 

 


ods graphics on / width=20cm;
proc sgplot data=CASUSER.want1 ;
/* by _CLUSTER_ID_; */
format diff_venta _o_opcionales_valor euro9.0;
by  cluster_description;
band y=diff_venta lower=-5000 upper= 0 / fillattrs=(color = lightgrey transparency=0.9);
ellipse y=diff_venta x=_o_opcionales_valor /  fill fillattrs=(transparency=0.8 color=liy);
reg y=diff_venta x=_o_opcionales_valor /  nomarkers lineattrs=(color=lightred); 
/* reg y=diff_venta x=_o_opcionales_valor / degree=2 nomarkers lineattrs=(color=orange) transparency=0.5;  */
text y=diff_venta x=diff_venta text=txt / textattrs=(size=12 color=firebrick) ;
scatter y=diff_venta x=_o_opcionales_valor / group=model dataskin=sheen markerattrs=(symbol=plus size=7) 
tip=(_o_opcionales_valor valor_venta_reparado _o_pff _o_actual_mileage meses_efectivos ) ;

/*    inset "Intercept = &Int" "Slope = &Slope" /  */
/*          border title="Parameter Estimates" position=topleft; */
xaxis grid;
yaxis grid;
/* xaxis values=(-5000 to 10000 by 5000); */
lineparm x=0 y=0 slope=1 / lineattrs=(color=lib pattern=4 thickness=2);
run;

pic2.pngpic1.png

 

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 0 replies
  • 407 views
  • 0 likes
  • 1 in conversation