ods pdf file="test1.pdf";
proc sgplot data=sashelp.class;
title 'Plot of Height vs Weight';
scatter x=height y=weight;
run;
ods pdf close;
ods graphics/outputfmt=pdf height=4in width=6in;
ods pdf file="test2.pdf";
proc sgplot data=sashelp.class;
title 'Plot of Height vs Weight';
scatter x=height y=weight;
run;
ods pdf close;
In the first PDF output, the title is correct. In the second PDF output, the word Weight disappears from the title, despite the fact that there is plenty of room. Why? The code is identical, except for the ODS GRAPHICS options.
First output:
Second output:
Does the same thing happen when you use the NOGTITLE option on the ODS PDF statement?
Does the same thing happen when you use the NOGTITLE option on the ODS PDF statement?
That seems to work properly. Any idea why?
@PaigeMiller wrote:
That seems to work properly. Any idea why?
I don't work with PDF's in general and don't recall ever using the output image format of PDF so this is a guess. I suspect that the rules for a PDF image does something to the space for titles, possibly a maximum percentage of the image width. Placing the text into the body of the document with the Nogtitle bypasses that bit. If you use the title options to set a smaller font does more of the text appear?
The ODS Graphics SCALE/NOSCALE option may come into play as well. I remember spending some time fighting with text in graphs in the first ODS RTF reports I did.
If I run that code after launching SAS without a custom autoexec and without a custom config file (so in other words, all settings at whatever SAS set them at), I get the problem. If you don't see the problem, that indicates a setting somewhere is different between your computer and my computer, but ... in my mind, it's not a SAS setting, as I get the problem with or without my custom autoexec and with or without my custom config file.
I think this is part of a similar ODS PDF problem I reported a few days ago, where the text was pixelated whereas the day before, using the same code, the text was not pixelated. I also suspect this may have something to do with a computer system upgrade that my company forced us to have that morning.
But I can't prove any of this, and I don't even know were to begin trying to track this down.
@PaigeMiller wrote:
If I run that code after launching SAS without a custom autoexec and without a custom config file (so in other words, all settings at whatever SAS set them at), I get the problem. If you don't see the problem, that indicates a setting somewhere is different between your computer and my computer, but ... in my mind, it's not a SAS setting, as I get the problem with or without my custom autoexec and with or without my custom config file.
I think this is part of a similar ODS PDF problem I reported a few days ago, where the text was pixelated whereas the day before, using the same code, the text was not pixelated. I also suspect this may have something to do with a computer system upgrade that my company forced us to have that morning.
But I can't prove any of this, and I don't even know were to begin trying to track this down.
Long shot here but have you checked if you have the latest video drivers for your system? Maybe the system "update" has an issue with a just-slightly-out-of-date video driver.
Could be ... but there's nothing I can do about it ... I have no choice in whatever updates are installed, and I can't change the video driver myself. But it would be helpful to know if that is the cause. I can't find what video driver is installed, and I have no idea what the video driver was before the problem happened.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register 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.