Save Graph (Data Management)

License Level:BasicStandardAdvanced

Summary

Saves a graph to an image, vector, or graph file.

Usage

Syntax

SaveGraph_management (in_graph, out_graph_file, {maintain_image_aspect}, {image_width}, {image_height})
ParameterExplanationData Type
in_graph

Input graph name or location.

You can input the location of an existing graph file (*.grf).

However, when you are using the tool in an ArcGIS application (ArcMap, ArcGlobe, or ArcScene), you can either input a graph present in the ArcGIS document or you can input the location of an existing graph file (*.grf).

File
out_graph_file

The output image, vector, or graph file.

The supported image and vector formats are:

  • Windows Bitmap (.bmp)
  • GIF(.gif)
  • JPEG (.jpg)
  • Portable Network Graphic (.png)
  • Paintbrush (.pcx)
  • Scalable Vector Graphics (.svg)
  • Adobe Acrobat PDF (.pdf)
  • Encapsulated PostsScript (.eps)
  • Enhanced Metafile (.emf)
  • Windows Metafile (.wmf)

File
maintain_image_aspect
(Optional)
  • MAINTAIN_ASPECT_RATIOThe aspect ratio of the output image will be preserved.
  • IGNORE_ASPECT_RATIO The aspect ratio of the output image will not be preserved.
Boolean
image_width
(Optional)

The width of the output image in pixels.

Integer
image_height
(Optional)

The height of the output image in pixels.

Integer

Code Sample

SaveGraph example (stand-alone script)

Save a graph as a Windows Bitmap image.

# Name: SaveGraph_ExampleBMP.py
# Description: Save a graph as an image

# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "c:/temp"

#Set local variables
graph_grf = "us_pop_2003.grf"
outputFile = "outgraph.bmp"
                
#Execute SaveGraph
arcpy.SaveGraph_management(graph_grf, outputFile, "MAINTAIN_ASPECT_RATIO")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013