BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
statz
Obsidian | Level 7

Hi, 

 

I would like to output a histogram with the normal density curve and the qqplot for a given data. With the following code, I can output the histogram and qqplot, but the histogram does not have the normal density curve. The normal density curve is included if the output is in html, BUT if the output is in pdf, it is not included. Does anyone know what is missing in my code? Thank you.

 

%LET path1= C:\Desktop\output1.pdf;*/output;
ods pdf file="&path1" NOGFOOTNOTE STARTPAGE=yes pdftoc=2 contents=yes style=printer bookmarklist=hide ;
data new;
input y @@;
datalines;
23 34
24 32
23 32
22 23
24 34
25 45
26 12
27 23
28 25
23 27
24 23
24 24
;
run;
ods select histogram qqplot ;
proc univariate data=new ;
histogram y/ grid normal( mu=est sigma=est color=red w=2.5) name='histogram' vscale=proportion;
qqplot y / normal( mu=est sigma=est color=red) name='qqplot' contents="" description="";
run;

ods pdf close;

 

 

By the way, I get this error: 


ERROR: Requested function is not supported.
ERROR: Unable to process the graph.

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I'm not an expert on the PDF destination, but this works for me when I get rid of all your options and just use:

ods pdf file="&path1";

Do you get any errors if you delete the options? Also, what version of SAS?

%put &SYSVLONG; /* look in SAS log for answer */

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

How are you running this program? Enterprise Guide? SAS Studio? SAS on your local PC?

Rick_SAS
SAS Super FREQ

I'm not an expert on the PDF destination, but this works for me when I get rid of all your options and just use:

ods pdf file="&path1";

Do you get any errors if you delete the options? Also, what version of SAS?

%put &SYSVLONG; /* look in SAS log for answer */

statz
Obsidian | Level 7
I'm using SAS 9.3 in my PC. I will try your suggestion. Thanks.
statz
Obsidian | Level 7

It worked. But I did not remove all options. I just removed the "style=printer" option. Thanks for your help!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 938 views
  • 0 likes
  • 2 in conversation