I have font stretching in the vertical axis as shown below. All values on the plot at stretched this way. I tried various sizes, reset graphics, set scale = off, nothing seems to work. What other options do I have?
How they do look:
How they should look
Code follows:
%macro figure_format1();
styleattrs datasymbols= (CircleFilled CircleFilled TriangleFilled TriangleFilled DiamondFilled DiamondFilled)
datacontrastcolors=(lipgr depk libgr vigb gray black)
datalinepatterns= (solid solid solid solid); *(dash solid dash solid);
legenditem type=markerline name="G4F" / label="Group4 FE"
lineattrs=(pattern=solid color=lipgr thickness=4)
markerattrs=(symbol=CircleFilled color=libgr size=9pt);
legenditem type=markerline name="G4S" / label="Group4 SE"
lineattrs=(pattern=solid color=depk thickness=4)
markerattrs=(symbol=CircleFilled color=depk size=9pt);
legenditem type=markerline name="G5F" / label="Group5 FE"
lineattrs=(pattern=solid color=libgr thickness=4)
markerattrs=(symbol=TriangleFilled color=libgr size=9pt);
legenditem type=markerline name="G5S" / label="Group5 SE"
lineattrs=(pattern=solid color=vigb thickness=4)
markerattrs=(symbol=TriangleFilled color=vigb size=9pt);
legenditem type=markerline name="G6F" / label="Group6 FE"
lineattrs=(pattern=solid color=gray thickness=4)
markerattrs=(symbol=DiamondFilled color=gray size=9pt);
legenditem type=markerline name="G6S" / label="Group6 SE"
lineattrs=(pattern=solid color=black thickness=4)
markerattrs=(symbol=DiamondFilled color=black size=9pt);
keylegend "G4S" "G4F" "G5S" "G5F" "G6S" "G6F" / title="";
%mend;
proc sgplot data=AVAL_mean NOAUTOLEGEND;
%figure_format1;
series x= MONTH y= MEAN / group= EYEFL LINEATTRS= (THICKNESS= 4);
scatter x= MONTH y= MEAN / group= EYEFL markerattrs= (size= 9pt);
xaxis min=0 max= 36 VALUES= (0 to 24 by 6,36) VALUESHINT minor minorcount=1
LABELATTRS=(size=12pt) VALUEATTRS=(size=12pt);
yaxis VALUESHINT minor minorcount=1
LABELATTRS=(size=12pt) VALUEATTRS=(size=12pt);
xaxistable N / x=MONTH class=EYE_N classorder=descending
LABELATTRS=(size=9pt) VALUEATTRS=(size=9pt);
run;
Graphics options to start:
ods graphics /reset;
options printerpath = pdf;
option orientation=landscape;
ods graphics / AttrPriority=None; * to override default attributes (color, line type, and marker, etc);
ods graphics on / width=9in height=6.5in scale = off;
Try these two things:
Let us know if that works.
A couple of questions:
Environment is Windows 11 PC Install
Output destination is PDF.
I think I may have found a solution.
Add the png device and give it an imagename
option orientation=landscape device = png;
ods graphics / imagename='Swimmer_93' AttrPriority=None;
The image approach should work, but try the other I mentioned as well. If it works, it will allow you to keep vector-based output, which tends to be sharper and create smaller PDF files.
For the image approach, you should set the output type on the ODS GRAPHICS statement, not on the DEVICE option (even though it worked). The OUTPUTFMT option is the supported way to specify the output type for ODS Graphics output. The IMAGENAME is not required here, as the image is embedded in the PDF file:
ods graphics / outputfmt=png;
Try these two things:
Let us know if that works.
Dan,
It appears to work fine. However, I need to keep the image option otherwise the fonts do not render correctly.
Thanks for your help!
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.