Data visualization with SAS programming

density curve in histogram not appearing in pdf file

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

density curve in histogram not appearing in pdf file

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.


Accepted Solutions
Solution
‎11-10-2015 11:44 AM
SAS Super FREQ
Posts: 3,406

Re: density curve in histogram not appearing in pdf file

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


All Replies
SAS Super FREQ
Posts: 3,406

Re: density curve in histogram not appearing in pdf file

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

Solution
‎11-10-2015 11:44 AM
SAS Super FREQ
Posts: 3,406

Re: density curve in histogram not appearing in pdf file

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 */

Contributor
Posts: 33

Re: density curve in histogram not appearing in pdf file

I'm using SAS 9.3 in my PC. I will try your suggestion. Thanks.
Contributor
Posts: 33

Re: density curve in histogram not appearing in pdf file

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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