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

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
  • 3 replies
  • 1175 views
  • 0 likes
  • 2 in conversation