I'm trying to create elevation graphs from a set of line features and raster elevation file, while the Stack Profile tool from ArcMap can do that, I need to modify the min/max values of the y-axis to make them uniform. I know I can manually change the values but I need to be able to automate the process of changing those values.

I have looked all over to find if there's way to do that, and the closest answer I got was the addSeriesBarMinMax function, which does not work for my graph. This is a test run of the code:

import arcpy
from arcpy import env




graph.addSeriesBarMinMax(graph, 400, 510)

And I get this error:

  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 5473, in SaveGraph
    raise e
RuntimeError: Object: Error in executing tool

Is there any way for me to modify the min/max y-values from ArcPy?

  • 1
    Try setting workspace to r"D:\"
    – Bera
    Commented Mar 21, 2017 at 20:57
  • No.... it gives me the exact same error. Thanks though
    – KieraS
    Commented Mar 21, 2017 at 21:04
  • 1
    Welcome to GIS SE! As a new user please take the tour to learn about our focused Q&A format.
    – Midavalo
    Commented Mar 22, 2017 at 13:01

1 Answer 1


It looks like you are losing your reference to test1.grf. Try naming one of your parameters differently, such as using input_graph as your input variable name.

import arcpy

arcpy.env.workspace = r"D:"

input_graph = "test1.grf"
output_graph = "test.grf"

graph = arcpy.Graph()

graph.addSeriesBarMinMax(input_graph, 400, 510)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.