edit: apologies. first time user not aware there is a separate graphics forum. if mods can move, please do.
hi
The following 2 pieces of code produce very different graphs even though the line thickness is 1.9px in the first and 2.0px in the second. It doesn't matter whether I use pt or px as the units (it just breaks at a different point).
If i create a png image instead of svg, it behaves exactly as expected. If I leave out the image_dpi option it behaves as expected. Using a lower dpi reduces the problem while higher dpi makes the problem even worse.
I require an svg file with at least 600dpi and I’d like to get an image with a line thickness somewhere between ultra-fine and pre-school crayola.
CODE 1:
ods html close;
ods html5 options(svg_mode="embed") image_dpi=600;
ods graphics /imagefmt=svg;
proc sgplot data=_plot noautolegend;
step x=time y=Survival / group=Stratum lineattrs=(thickness=1.9px);
scatter x=time y=Censored / group=Stratum markerattrs=(symbol=plus size=8);
run;
ods html5 close;
ods html;
CODE2:
ods html close;
ods html5 options(svg_mode="embed") image_dpi=600;
ods graphics /imagefmt=svg;
proc sgplot data=_plot noautolegend;
step x=time y=Survival / group=Stratum lineattrs=(thickness=2px);
scatter x=time y=Censored / group=Stratum markerattrs=(symbol=plus size=8);
run;
ods html5 close;
ods html;
I see you still use imagefmt=.
It's called outputfmt= nowadays. (The OUTPUTFMT= option was previously named the IMAGEFMT= option.)
I can confirm the problem with line thickness gets worse as the DPI (image_dpi=) increases, but I don't know why.
I usually use image_dpi=600 myself.
What if you use another ODS destination?
You can use OUTPUTFMT=SVG with
What if you use another vector-based format?
Like
BR, Koen
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →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.