BookmarkSubscribeRSS Feed
Ken_oy
Fluorite | Level 6
Hi everyone,

How can we export graph (from proc gplot) to a jpg format file (or bmp, or other)?
Any example?

Thanks!
5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12
Check the documentation for

OPTIONS DEV=JPEG;
Ken_oy
Fluorite | Level 6
Thanks, can you tell me how?

Any example code, please?

Thanks a lot.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Explore the SAS support http://support.sas.com/ website and ODS with SAS/Graph generated outputs.

Scott Barry
SBBWorks, Inc.
Cynthia_sas
Diamond | Level 26
Hi:
There are several different methods...depending on what kind of graphs you're creating (which procedure used):

A.) Device-based graphics (such as from PROC GCHART, GPLOT, etc)
--1) When you are looking at the graph in the GRAPH1 window, select
FILE --> Export As Image
or EDIT --> Edit Current Graph and then do a FILE --> Export from the Edit window;
--2) use ODS HTML with DEVICE=
--3) use FILENAME and GSFNAME and GSFMODE techniques with DEVICE=

B) Template-based graphics (such as from PROC SGPLOT, SGPANEL, etc or the use of ODS GRAPHICS ON/OFF with statistical procedures)
--1) Use the ODS GRAPHICS statement to control the IMAGEFMT= option however, these template-based graphics are already created as external files, so all you need to do is change the IMAGEFMT


Please note that these methods are all SEPARATE methods. That means if you're using ODS from A, you would -not- use method 1 or 3 and if you're using the Export method, you would -not- also use methods 2 or 3. Also you would not mix device-based methods (A) with template-based methods (B).

Searching Tech Support notes and the documentation should provide you plenty of examples and explanations.

cynthia
ChrisNZ
Tourmaline | Level 20
JPG is a bad format for "normal" graphs, where there are solid colors and sharp edges. PNG or even GIF would be better.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4281 views
  • 0 likes
  • 5 in conversation