ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Save Graph

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

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

Usage

  • Using this tool you can save a graph as a graph file (.grf) or as one of the image and vector formats below.

    Image formatsVector formats

    Windows Bitmap (.bmp)

    Scalable Vector Graphics (.svg)

    GIF(.gif)

    Adobe Acrobat PDF (.pdf)

    JPEG (.jpg)

    Encapsulated PostsScript (.eps)

    Portable Network Graphic (.png)

    Enhanced Metafile (.emf)

    Paintbrush (.pcx)

    Windows Metafile (.wmf)

    Export formats for graphs
  • When saving the graph to the desired format, you need to specify the file extension in the output file name. For example, if you want to export a graph to a Windows Bitmap, you need to specify the output file name as C:\temp\outGraph.bmp.

  • This tool will not work on a non-Windows platform.

Syntax

arcpy.management.SaveGraph(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_RATIO —The 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

  • Current Workspace

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Graph toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal