How to plot two lines in a graph?

877
2
12-12-2016 06:12 PM
ChenGuo
New Contributor

I'm trying to create a an arctool with two inputs: a line feature and multiple layer. I want the tool to do the StackProfile and display the profile of this line feature on the multiple layers in a graph, so that I can compare the difference. Here are some codes:

graph = arcpy.Graph()

num = 0

for profileTarget in profileTargets:

      profileTable = "test" + str(num)

      target = profileTarget.name

      arcpy.ddd.StackProfile( profileLine, target, profileTable)

      graph.addSeriesLineVertical( profileTable, "FIRST_Z", "FIRST_DIST")

      num += 1

graphName = "VerticalBarGraph"

arcpy.manegement.MakeGraph( inputTemplate, graph, graphName)

graphFile = "test.png"

arcpy.management.SaveGraph( graphName, graphFile)

When there is only one surface layer, it works fine. But an error occured when there are more than one layer at MakeGraph function, it seems a arcpy.Graph can't have two vertical lines displayed. Anyone has ideas about this or some other solution can I use?

Tags (2)
0 Kudos
2 Replies
DanPatterson_Retired
MVP Esteemed Contributor

do you remember the error?

0 Kudos
ChenGuo
New Contributor

It says my parameter is unvalid:

ERROR 001020: Input series error. Parameter list is incompatible.

0 Kudos