BookmarkSubscribeRSS Feed
ammarhm
Lapis Lazuli | Level 10

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

3 REPLIES 3
Reeza
Super User

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. 

ammarhm
Lapis Lazuli | Level 10

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

Reeza
Super User

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...

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1294 views
  • 0 likes
  • 2 in conversation