I create some plots yesterday using ODS PDF and the exact same program as today using ODS LAYOUT GRIDDED and PROC SGPLOT. Yesterday's output to ODS PDF provided sharp clear text; today's output has pixelated text. Why does this happen if the code doesn't change? The code is what I provided here. (If your question is why would I run code on SASHELP.CLASS on two different days ... I actually did this on real data where I wanted updated data and saw pixelated text, but then I re-ran it on SASHELP.CLASS and the problem also appears to happen running the code on SASHELP.CLASS today)
Here are examples. The first plot is the sharp clear text from yesterday's run, the second is the pixelated text from today's run. (The output is copied from Acrobat Reader, where the magnification in both cases is 100%) I have also attached the actual PDF files, test1.pdf is yesterday's run which is not pixelated; test2.pdf is the new run which is pixelated.
Thanks, @DanH_sas
ods graphics / outputfmt=svg;
didn't work but this does:
ods graphics / outputfmt=pdf;
Any idea why this might have changed? Is it dependent on some other option perhaps? I can say with 100% certainty that I have never used the outputfmt= option in the 27.4326 bazillion lines of SAS code that I have written in my life (I never even heard of this option before).
Anyway, problem solved!
How are you running the SAS job? (batch sas, dms sas, enterprise guide, sas studio, viya, etc)
Are you leaving the same SAS session up overnight, and running both versions in the same SAS session? Or are you opening a new/fresh SAS session on the 2nd day?
I run it in the SAS display manager. The second one was run in a new SAS session — in fact, I realized this after I posted, although I'm not sure why it might make a difference, my company's IT dept forced a reboot of my PC this morning before I came in to work, to do whatever system updates were required.
FWIW, neither the posted images nor the PDF documents appear pixelated when I view them. Not saying it isn't happening but it may point to individual computer settings and versions of viewing applications.
@ballardw wrote:
FWIW, neither the posted images nor the PDF documents appear pixelated when I view them. Not saying it isn't happening but it may point to individual computer settings and versions of viewing applications.
Can't rule that out ... these things can be tricky to track down, and most definitely could be caused by something other than SAS.
Here is the same two files, blown up to 400% using Adobe Acrobat, so you can clearly see the pixelization if you click on each image to see them full size here in the SAS Communities.
First attempt (no pixelization)
Second attempt (pixelization)
To me, it appears that the first output was generated using vector-based PDF, and the second graph was generated as an image in the PDF (vector-based is the default). I'm not sure if something in your environment is changing the OUTPUTFMT in your program runs, but you can force vector-based output using by setting the OUTPUTFMT to SVG:
ods graphics / outputfmt=svg;
Thanks, @DanH_sas
ods graphics / outputfmt=svg;
didn't work but this does:
ods graphics / outputfmt=pdf;
Any idea why this might have changed? Is it dependent on some other option perhaps? I can say with 100% certainty that I have never used the outputfmt= option in the 27.4326 bazillion lines of SAS code that I have written in my life (I never even heard of this option before).
Anyway, problem solved!
Again, it could be something in your environment that is changing the OUTPUTFMT explicitly. It could be anything from an autoexec to a sneaky ODS GRAPHICS line buried in some code you ran 🙂
I'm pretty sure nothing changed in my AUTOEXEC. The only ODS GRAPHICS code I used in this code is
ods graphics/height=3in width=4in;
How do you run SAS (e.g DMS, SAS Studio, Enterprise Guide, batch, etc)?
Display manager
Hmmm... then I'm not sure where to look. There is no auto-generated code in the this case that would affect your program.
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.