Data visualization with SAS programming

ODS graphics overriding CFILL in proc univariate

Reply
Frequent Contributor
Posts: 135

ODS graphics overriding CFILL in proc univariate

[ Edited ]

Hi all

A very simple question:

I need to get a histogram in black and white and in eps format

 

Here is the challenging part.

I am using proc univariate to get the histogram, if I turn ods graphics on to be able to control the image output format (eps), this will override the CFILL order, so the histogram comes out coloured not black and white:

 

%let gpath='C:\Users\User\Documents\My SAS Files\';
%let dpi=300;
ods listing gpath=&gpath image_dpi=&dpi   ;
ods graphics / outputfmt=epsi   imagename='Fig1';

proc univariate data=k5;
format inr t.;
   histogram INR / cfill=black cbarline=white endpoints=(1 to 9 by 1) ;
run;

If I turn on graphics, I can get the colours the way I want but I cant control the output format

Any solusion for this please?

Maybe using proc template? but I am not that good with GTL

Kind regards

Grand Advisor
Posts: 17,396

Re: ODS graphics overriding CFILL in proc univariate

[ Edited ]

Change your style to JOURNAL. 

 

ODS LISTING STYLE=Journal;

 

I don't think this will get you exactly what you want but should be closer. The Journal style is for publications and is black and white. 

 

Theres also JOURNAL2. 

 

See the examples linked here, a bit buried albeit. 

Frequent Contributor
Posts: 135

Re: ODS graphics overriding CFILL in proc univariate

Thanks Reza

It didnt work, i couldnt save the output as eps: I received the following error

 

WARNING: HTML4 destination does not support EPSI images. Using the default static format.

NOTE: The graph will be rendered as an image due to the use of transparency.

NOTE: PROCEDURE UNIVARIATE used (Total process time):

      real time           0.51 seconds

      cpu time            0.34 seconds

Grand Advisor
Posts: 17,396

Re: ODS graphics overriding CFILL in proc univariate

Your initial code doesn't mention ODS HTML only LISTING or show an error. In the future please include all relevant information. If something doesn't work, post the full code and log, since doesn't work is a vague term. 

 

The docs do say that EPS is not supported for HTML. Either turn off HTML or use an SVG format instead. 

 

ODS HTML CLOSE; 

 

http://support.sas.com/documentation/cdl/en/odsug/69832/HTML/default/viewer.htm#p0kroq43yu0lspn16hk1...

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 181 views
  • 0 likes
  • 2 in conversation