Outputing a High Resolution Image of a Line Graph

sas

    Next

  • 1. REMINDER -- SAS-L BOF at SAS Global Forum!
    Will you be attending the very first SAS Global Forum next week in Orlando? We're sure that the conference will be filled with highlights -- opening session, giant demo area, more presentations than you can even think about attending, meeting M-I-C-K-E-Y, etc., etc. However, the one event that you absolutely will not want to miss is ... The One-and-only, Annual SAS-L Birds of a Feather Get-together! When: Tuesday, April 17, 2007 Where: Southern Hemisphere IV Time: 7:00 - 8:00 pm Be sure and take this opportunity to - HEAR the latest statistics on SAS-L postings (and post-ers) SEE who wins the coveted SPORTY, SASLROY, and MVS awards. (Will anyone be inducted into the Hall of Fame this year???) JOIN a discussion on the future of SAS information-sharing in the 21st century and, last but certainly not least MEET many of your favorite SAS-Lers! We certainly hope to see many of you there! The SAS Global Forum 2007 SAS-L BOF Planning Committee, Ron Fehd ( XXXX@XXXXX.COM ) Jack Hamilton ( XXXX@XXXXX.COM ) Larry Hoyle ( XXXX@XXXXX.COM ) Joe Kelley ( XXXX@XXXXX.COM ) Mike Rhoads ( XXXX@XXXXX.COM ) Dianne Rhodes ( XXXX@XXXXX.COM ) Bill Viergever ( XXXX@XXXXX.COM )
  • 2. A DATASET QUESTION
    I have a dataset as below: Subject VariableUN ------- ----------- 1 City Bus leaving - ONGO; 2 Cneter city, california 3 City center colosed - ONGO 4 Center city working - ONGO; 5 Uptown Bronx, New York; 6 Mall center Closed ONGO I will need an output where variableUN contains 'ONGO' and it should be at the end of the variable's value, but not always since some values ends with ';' since there is some Data Cleaning issues. If a value contains 'ONGO' then in the result we should have it as 'A' if not then 'B'. Need a Result Subject VariableUN --------- ----------- 1 A 2 B 3 A 4 A 5 B 6 A Thanks in advance.

Outputing a High Resolution Image of a Line Graph

Postby pmiller » Thu, 18 Oct 2007 04:02:42 GMT

Hello Everyone,

I'm trying to output a high resolution image of a line graph that I can
easily email to people and that looks nice when printed. I've come
pretty close to accomplishing my goal but my output looks a little
stretched and the symbols for each of the lines come out looking very
small. Also, I'm not sure if .png is the right type of image for what
I'm trying to do.

Any help would be greatly appreciated. The syntax I'm using appears
below.

Thanks,

Paul

Paul J. Miller, Ph.D.
Research Scientist and Statistician
Ontario HIV Treatment Network
1300 Yonge St., Suite 308
Toronto, Ontario M4T 1X3
Phone: (416) 642-6486 ext 232
Fax: (416) 640-4245


ODS HTML BODY='C:\Documents and Settings\pmiller\Desktop\Test.htm'
           GPATH='C:\Documents and Settings\pmiller\Desktop\'
(URL=NONE);
           GOPTIONS DEVICE=PNG XPIXELS=2000 YPIXELS=1500 XMAX=8IN
YMAX=6IN;

PROC GPLOT DATA=&DSN;
        FORMAT DATE YEAR4.;
        PLOT SUM_CW_M184_NRTI * DATE
                 SUM_CW_M184_NRTI_PI * DATE
                 SUM_CW_M184_NRTI_NNRTI * DATE
                 SUM_CW_M184_NNRTI * DATE
                 SUM_CW_M184_PI * DATE
                 SUM_CW_NRTI_NNRTI * DATE
                 SUM_CW_NRTI_NNRTI_PI * DATE
                 SUM_CW_NRTI_PI * DATE
                 SUM_CW_M184_NNRTI_PI * DATE
                 SUM_CW_NNRTI_PI * DATE / OVERLAY HAXIS=AXIS1
VAXIS=AXIS2 LEGEND=LEGEND1 NOFRAME;
RUN;
QUIT;

ODS HTML CLOSE;

Re: Outputing a High Resolution Image of a Line Graph

Postby mehdi_soleymani » Thu, 18 Oct 2007 11:48:07 GMT

I think you can do somethings which make your graph better:



1) change the default fonts, for example, if you are going to define the
symbols it is better to use "Symbol" and for texts maybe "Euclid" and ...

2) use vector graphics devices for example choose devices which produce WMF

3) change default colors, it is funny but it is so helpful


SAS graph defult options are chosen such a way that speed of producing is
faster and plotting is independent of platform, thus having a better graph
simply means changing the default things :)

Outputing a High Resolution Image of a Line Graph

Postby pjmiller_57 » Thu, 18 Oct 2007 23:12:03 GMT

Hi Sam and Mehdi,

  Thanks for your replies. I'm in my other office until Friday and so I won't be able to fully test your suggestions until then. In the meantime though, I decided to do a quick test using the pdf option that Sam suggested. Although I don't currently have access to a colour printer, the black-and-white print seems to be of quite high resolution. So pdf looks like a quick and easy solution to my problem. And if the graph doesn't look good in colour, I should be able to use Mehdi's suggestions to improve it.

  Thanks for your help.

  Paul




---------------------------------
 Check out  the hottest 2008 models today at Yahoo! Autos.

Similar Threads:

1.Creating a High Resolution Image of a SAS Dataset

Hello Everyone,

  I'm trying to create a high resolution image (not a screen shot) of a SAS dataset for use in a conference poster. I understand that .tiff and .eps are best formats for this purpose but likely would be willing to settle for any format that is high resolution at this point.

  So far, I've learned how to output .eps images but these can only be viewed with "Ghostview" and this is proving to be a problem. SAS also doesn't seem to be very good at producing .tiff images although it is capable of doing that.

  Does anyone have any suggestion about how to proceed?

  Thanks,

  Paul


---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

2.FW: How to high resolution ODS graphics images for PowerPoint

I hate to burst people's bubble, BUT ODS does not appear to be able to produce vector output. The code shown here produces an image and the extension is emf, but it is in fact really a bit mapped file. Opening it in a vector program such as Adobe Illustrator shows that it is one image, you can not select any parts of the image (except the whole) and when blown up to 300% clearly shows characteristics of a bit mapped image.

I went through this a number of months ago, trying every example, every trick I could think of without success. I finally called SAS and when the customer service person talked to the programmers, they told me that regardless of the extension, the images are bit mapped. Major disappointment.

So far, the only way I've found to get vector images is use the regular graph, open the graph output window and then do File/Export as emf. Then it is a vector image that can be used.

Morley Herbert



-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of Chang Chung
Sent: Tuesday, June 30, 2009 9:05 AM
To:  XXXX@XXXXX.COM 
Subject: Re: How to high resolution ODS graphics images for PowerPoint

On Mon, 29 Jun 2009 17:09:43 -0400, Richard Hoskins < XXXX@XXXXX.COM > wrote:

>SAS 9.2, Once I get an ODS graphics image in the Results window I need
>to save that image for importinging into WORD or PowerPoint. But the
>only options appear to be bmp or png. The png image is not of high
>enough resolution that it looks OK in a Powerpoint slide.
>
>1) How can I save the image to a higher resolution? more dots/cm
>2) Can the results window image be saved to other formats? (GIF)
>especially to a vector format (EMF) ?

Hi,

Unlike the old sas graphics system, the new statistics graphic proc's (or sg
procs) generate images directly. And it chooses appropriate image format for the active ods destination.

If you generate raster images, then you can use the image_dpi= option when you open the destination. For vector images like emf, setting dpi does not make sense at all. It should automatically increase/decrease dpi depending on the device. You just set the size (width, height) and windows GDI should take care of the dpi, in order to maintain the given size. ODS graphics'
default aspect ratio is width:height=4:3, unless you override it.

Below, I show two examples. Hope this helps a bit.

Cheers,
Chang

<sasl:code sysvlong="9.02.01M0P020508" sysscpl="W32_VSPRO"> %let pwd = %sysfunc(pathname(WORK)); %put pwd=&pwd; x cd &pwd;

/* generating a large emf file (width=8inch) */ ods listing style=journal; ods graphics on / width=8in imagefmt=emf imagename="emf";
  proc sgplot data=sashelp.class;
    scatter x=height y=weight / group=sex;
  run;
ods graphics off;

/* generating a 300 dpi gif file */
ods listing style=journal image_dpi=300; ods graphics on / reset=all imagefmt=gif width=4in imagename="gif";
  proc sgplot data=sashelp.class;
    scatter x=height y=weight / group=sex;
  run;
ods graphics off;
/* generated graph file (gif.gif)^s demension: 1200 x 900 pixels */ </sasl:code>

3.How to high resolution ODS graphics images for PowerPoint

SAS 9.2, Once I get an ODS graphics image in the Results window I need to
save that image for importinging into WORD or PowerPoint. But the only
options appear to be bmp or png. The png image is not of high enough
resolution that it looks OK in a Powerpoint slide.

1) How can I save the image to a higher resolution? more dots/cm
2) Can the results window image be saved to other formats? (GIF) especially
to a vector format (EMF) ?

thanks -

4.SAS/Graph TIFF Image Resolution

Hi folks,

Continuing a task that got interrupted from last week, I am still attempting to create some decent images of SAS/Graph output as TIFF files.  Last week, I found that the File->Export as Image... menu item did not provide any way to allow the image resolution to be specified, and always appears to default to screen resolution, around 72 to 100 dpi.  This low resolution produces jaggies in slanted lines, and blocky, ugly looking text when used for hardcopy output.

I contacted SAS Tech Support regarding this problem, and they recommended using the TIFFP driver instead of the Export dialogue.  While going that route introduces other complications for my needs, it seemed like a reasonable work-around...

Unfortunately, I can't seem to get any higher resolution by using the TIFFP driver.  For example, here are a couple of different goption statements that I used with consecutive runs of a program that creates a number of plots:

goptions device=TIFFP papersize=(11,17) hsize=11 vsize=17 xpixels=%eval(11*300) ypixels=%eval(17*300) hpos=110 vpos=102
gsfname=GraphOut gsfmode=replace;
 
goptions device=TIFFP papersize=(11,17) hsize=11 vsize=17 xpixels=%eval(11*600) ypixels=%eval(17*600) hpos=110 vpos=102
gsfname=GraphOut gsfmode=replace;

As you can see, I specified an output size of 11 x 17 inches (hsize and vsize weren't defaulting properly, so I had to specify those as well), a resolution of 300 dpi for one set of plots, and 600 dpi for the other set.  In spite of that, when I viewed the output image files and inspected their properties, I found that BOTH sets were created with identical dimensions of 1045 pixels by 1615 pixels, or less than 100 dpi.

As a result, I plan to contact SAS Tech Support once again regarding this issue.  However, they won't be able to get back to me until tomorrow at best.  In the mean time, does anyone else out there have an idea of something that I can or should be doing differently in order to obtain higher quality TIFF image resolutions of 300 to 600 dpi?

Thanks
s/KAM

5.SAS/Graph Image Resolution

I would like to create a TIFF file of the output from a SAS/Graph procedure.  Using File->Export as Image, I can create a TIFF image, but it seems to be created based on the relatively low screen resolution (72 or 100 dpi) rather than at a higher resolution appropriate for further manipulation and printing (300 to 600 dpi).  How can I control the resolution of TIFF images that are created using SAS???  Thanks,

s/KAM

6. Configuring imported image resolution

7. SAS/GRAPH: Resolution & File Size of Jpeg

8. Proc Report, PDF's, Blank Lines, and a high level of frustration



Return to sas

 

Who is online

Users browsing this forum: No registered users and 15 guest