The SAS Output Delivery System and reporting techniques

sgplot and tiff

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

sgplot and tiff

I am trying to get a tif file from a sgplot as a high resolution tif file for a publication.

But can't get it to work...

No matter what I set the dpi resolution to a get a file with 100 dpi - but size of file dramatically increases.

The tif file has to be 15 cm wide and have a resolution on at least  300 dpi

 

SAS throws a warning “WARNING: SASREPORT13 destination does not support TIFF images. Using the default static format.

 

Any suggestions

In this litte test example I using the good old sashelp.class

 

 

goptions reset=all ;
ods graphics on /
                          imagefmt=tiff
                         imagename="class_test"
                         width=15cm
                         noborder;

 

ods listing gpath= "c:\temp" image_dpi=300 ;

 

proc sgplot data=sashelp.class;
title;
scatter x=height y=weight;
quit;
run;

ods graphics off;
ods html close;

run;

 

 


Accepted Solutions
Solution
‎05-08-2017 05:38 AM
SAS Super FREQ
Posts: 8,815

Re: sgplot and tiff

[ Edited ]

Hi:
Are you using SAS Enterprise Guide? The message tells you that your TIF is not being used because the SASREPORT default output from EG is active and that SASREPORT destination used by EG does not support TIFF format. You could try turning that off with ODS _ALL_ CLOSE; before your job. Also, your ODS HTML CLOSE is unnecessary, since you do not show an opening ODS HTML statement.

When I change your code just a bit, as shown below, I get an output file created as a TIFF. And, if I look in Paint, I see that the image properties of 15cm and 300 dpi were correctly set.

image_properties.png

 

And here's the LOG in EG...note where I put my ods _ALL_ close; statement:

class_test_example_eg.png

 

cynthia

View solution in original post


All Replies
Super User
Super User
Posts: 7,682

Re: sgplot and tiff

300dpi sounds a bit high for a graph.  Anyways, there is another post about this:

https://communities.sas.com/t5/General-SAS-Programming/Help-to-make-300dpi-TIFF-ROC-graph/td-p/10084...

 

Not sure how helpful that is.  Sounds like a support ticket to me, yuo may have to post process the output and up res the graphics.

Solution
‎05-08-2017 05:38 AM
SAS Super FREQ
Posts: 8,815

Re: sgplot and tiff

[ Edited ]

Hi:
Are you using SAS Enterprise Guide? The message tells you that your TIF is not being used because the SASREPORT default output from EG is active and that SASREPORT destination used by EG does not support TIFF format. You could try turning that off with ODS _ALL_ CLOSE; before your job. Also, your ODS HTML CLOSE is unnecessary, since you do not show an opening ODS HTML statement.

When I change your code just a bit, as shown below, I get an output file created as a TIFF. And, if I look in Paint, I see that the image properties of 15cm and 300 dpi were correctly set.

image_properties.png

 

And here's the LOG in EG...note where I put my ods _ALL_ close; statement:

class_test_example_eg.png

 

cynthia

New Contributor
Posts: 3

Re: sgplot and tiff

Yes I'm using SAS EG, version 7.11

 

I addedd the ODS _ALL_CLOSE and got rid of the warning :-)

 

However, when opening the file in Paint and looks at properties I get the same file size as you (6.75 MB) do but image width=42.01 cm and DPI=100.

 

From log:

 

23 GOPTIONS ACCESSIBLE;

24

25

26 ODS _ALL_ CLOSE;

27

28 goptions reset=all ;

29 ods graphics on /

30 imagefmt=tiff

31 imagename="class_test"

32 width=15cm

33 noborder;

34

35

36

37 ods listing gpath= "c:\temp" image_dpi=300 ;

38

39

40

41 proc sgplot data=sashelp.class;

42 title;

43 scatter x=height y=weight;

44 quit;

NOTE: PROCEDURE SGPLOT used (Total process time):

real time 0.31 seconds

cpu time 0.14 seconds

 

NOTE: Listing image output written to c:\temp\class_test1.tiff.

NOTE: There were 19 observations read from the data set SASHELP.CLASS.

45 run;

46

47 ods graphics off;

48

49 run;

 

 

 

 

 


properties.png
SAS Super FREQ
Posts: 8,815

Re: sgplot and tiff

Hi:
The only thing I can recommend is to delete all your older or previous files AND/OR change the name from class_test to something else. Notice how you told it to create class_test, but it actually created class_test1.tiff. Are you sure you are looking at the properties of the right file?

If you change to a new name and use the code and still get the wrong CM value, then your best resource is to open a track with Tech Support.

cynthia
☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 188 views
  • 0 likes
  • 3 in conversation