<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Empty graph output from StackProfile_3d-&amp;gt;SaveGraph_management in 3D Questions</title>
    <link>https://community.esri.com/t5/3d-questions/empty-graph-output-from-stackprofile-3d-amp-gt/m-p/119666#M694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mathiaskopo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://gis.stackexchange.com/questions/91377/why-is-arcpy-stackprofile-3d-arcpy-savegraph-management-creating-empty-graph" rel="nofollow" target="_blank"&gt;http://gis.stackexchange.com/questions/91377/why-is-arcpy-stackprofile-3d-arcpy-savegraph-management-creating-empty-graph&lt;/A&gt;&lt;SPAN&gt; I learned that this is a bug in 10.1 &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://support.esri.com/en/bugs/nimbus/TklNMDkyMzc3" rel="nofollow" target="_blank"&gt;http://support.esri.com/en/bugs/nimbus/TklNMDkyMzc3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of using the graph output from StackProfile_3d it is possible to create a graph from the value table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With this approach it is also possible to customize the look of the graph using a graph text template which first must be created, see intructions in the code below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy &amp;nbsp;&amp;nbsp;&amp;nbsp; # Set Local Variables &amp;nbsp;&amp;nbsp;&amp;nbsp; homedir = "C:/mpo/opgaver/grafer/data.gdb/" &amp;nbsp;&amp;nbsp;&amp;nbsp; home = "C:/mpo/opgaver/grafer/" &amp;nbsp;&amp;nbsp;&amp;nbsp; profileLine = homedir+"profile" &amp;nbsp;&amp;nbsp;&amp;nbsp; profileTargets = homedir+"raster" &amp;nbsp;&amp;nbsp;&amp;nbsp; profileTable = homedir+"value" &amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_name = "VerticalBarGraph6" &amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_pic = home+"graph.png" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Graph template to use,&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # 1) Create graph in ArcGIS: View-&amp;gt; Graphs-&amp;gt; Create Graph-&amp;gt; Next-&amp;gt; Finish &amp;nbsp;&amp;nbsp;&amp;nbsp; # 2) Then save as template file: Rigth click graph from 1)-&amp;gt; Export-&amp;gt; Native-&amp;gt; Text-&amp;gt; Save &amp;nbsp;&amp;nbsp;&amp;nbsp; # 3) Rename .txt file to .tee &amp;nbsp;&amp;nbsp;&amp;nbsp; input_template = home+"line2.tee" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Execute StackProfile &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.StackProfile_3d(profileLine, profileTargets, profileTable) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the graph &amp;nbsp;&amp;nbsp;&amp;nbsp; graph = arcpy.Graph() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Add a vertical line series to the graph &amp;nbsp;&amp;nbsp;&amp;nbsp; graph.addSeriesLineVertical&amp;nbsp; (profileTable, "FIRST_Z", "FIRST_DIST", "" , "") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Output a graph, which is created in-memory &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeGraph_management(input_template, graph, out_graph_name) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the graph as an image &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveGraph_management(out_graph_name, out_graph_pic,"IGNORE_ASPECT_RATIO", 900, 200)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Mar 2014 08:46:09 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2014-03-31T08:46:09Z</dc:date>
    <item>
      <title>Empty graph output from StackProfile_3d-&amp;gt;SaveGraph_management</title>
      <link>https://community.esri.com/t5/3d-questions/empty-graph-output-from-stackprofile-3d-amp-gt/m-p/119665#M693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In a python script I'm trying to save a graph to a .png file with graph output from arcpy.StackProfile_3d but the .png file shows an empty graph. The table created from arcpy.StackProfile_3d shows values. Does anybody know why the graph is still empty?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy # Set Local Variables profileLine = "C:/temp/data.gdb/profile" profileTargets = "C:/temp/data.gdb/raster" profileTable = "C:/temp/value.dbf" graphName = "Sample Graph" outGraph = "C:/temp/graph.png"&amp;nbsp; # Execute StackProfile arcpy.StackProfile_3d(profileLine, profileTargets, profileTable, graphName)&amp;nbsp; # # Execute SaveGraph arcpy.SaveGraph_management(graphName, outGraph, "MAINTAIN_ASPECT_RATIO")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]32624[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2014 11:03:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/3d-questions/empty-graph-output-from-stackprofile-3d-amp-gt/m-p/119665#M693</guid>
      <dc:creator>MathiasKP</dc:creator>
      <dc:date>2014-03-30T11:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Empty graph output from StackProfile_3d-&gt;SaveGraph_management</title>
      <link>https://community.esri.com/t5/3d-questions/empty-graph-output-from-stackprofile-3d-amp-gt/m-p/119666#M694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mathiaskopo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://gis.stackexchange.com/questions/91377/why-is-arcpy-stackprofile-3d-arcpy-savegraph-management-creating-empty-graph" rel="nofollow" target="_blank"&gt;http://gis.stackexchange.com/questions/91377/why-is-arcpy-stackprofile-3d-arcpy-savegraph-management-creating-empty-graph&lt;/A&gt;&lt;SPAN&gt; I learned that this is a bug in 10.1 &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://support.esri.com/en/bugs/nimbus/TklNMDkyMzc3" rel="nofollow" target="_blank"&gt;http://support.esri.com/en/bugs/nimbus/TklNMDkyMzc3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of using the graph output from StackProfile_3d it is possible to create a graph from the value table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With this approach it is also possible to customize the look of the graph using a graph text template which first must be created, see intructions in the code below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy &amp;nbsp;&amp;nbsp;&amp;nbsp; # Set Local Variables &amp;nbsp;&amp;nbsp;&amp;nbsp; homedir = "C:/mpo/opgaver/grafer/data.gdb/" &amp;nbsp;&amp;nbsp;&amp;nbsp; home = "C:/mpo/opgaver/grafer/" &amp;nbsp;&amp;nbsp;&amp;nbsp; profileLine = homedir+"profile" &amp;nbsp;&amp;nbsp;&amp;nbsp; profileTargets = homedir+"raster" &amp;nbsp;&amp;nbsp;&amp;nbsp; profileTable = homedir+"value" &amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_name = "VerticalBarGraph6" &amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_pic = home+"graph.png" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Graph template to use,&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # 1) Create graph in ArcGIS: View-&amp;gt; Graphs-&amp;gt; Create Graph-&amp;gt; Next-&amp;gt; Finish &amp;nbsp;&amp;nbsp;&amp;nbsp; # 2) Then save as template file: Rigth click graph from 1)-&amp;gt; Export-&amp;gt; Native-&amp;gt; Text-&amp;gt; Save &amp;nbsp;&amp;nbsp;&amp;nbsp; # 3) Rename .txt file to .tee &amp;nbsp;&amp;nbsp;&amp;nbsp; input_template = home+"line2.tee" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Execute StackProfile &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.StackProfile_3d(profileLine, profileTargets, profileTable) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the graph &amp;nbsp;&amp;nbsp;&amp;nbsp; graph = arcpy.Graph() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Add a vertical line series to the graph &amp;nbsp;&amp;nbsp;&amp;nbsp; graph.addSeriesLineVertical&amp;nbsp; (profileTable, "FIRST_Z", "FIRST_DIST", "" , "") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Output a graph, which is created in-memory &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeGraph_management(input_template, graph, out_graph_name) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the graph as an image &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveGraph_management(out_graph_name, out_graph_pic,"IGNORE_ASPECT_RATIO", 900, 200)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 08:46:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/3d-questions/empty-graph-output-from-stackprofile-3d-amp-gt/m-p/119666#M694</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-03-31T08:46:09Z</dc:date>
    </item>
  </channel>
</rss>

