<?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 using Z and M feature geometry to create line graph in Python? in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/using-z-and-m-feature-geometry-to-create-line/m-p/27928#M113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: willfish&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, I am a Python (v2.6.5) noob trying to plot a series of 3D polylines into graphs. So far I've come up with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Import system modules
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy, os, sys, string
&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy import env

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Modules imported."

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set environment settings
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = r"X:\HaulRoad\SpatialData"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.scratchWorkspace = r"X:\HaulRoad\SpatialData"

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Workspaces set."

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set local variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; infc = "\HaulRd.gdb\Treatment\XS_2009BEBRklnTerr_interpZ_Rte_isect"
&amp;nbsp;&amp;nbsp;&amp;nbsp; graph_template = r"\XS\XS_Seg02.55.grf"&amp;nbsp; # template graph originally created with 3d Analyst profile tool, customized in Advanced Properties, then exported to grf format

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Local variables set."


&amp;nbsp;&amp;nbsp;&amp;nbsp; #create list of fields of interest from FC or table of interest
&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = ['SegID','STA_calc','shape.Z','shape.M']


&amp;nbsp;&amp;nbsp;&amp;nbsp; #create empty list for cursor to populate
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = []

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Table and empty list created."

&amp;nbsp;&amp;nbsp;&amp;nbsp; # use search cursor to get field value for a given record 
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(infc, "", "", "SegID; STA_calc")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row.SegID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row.STA_calc)

&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, rows

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Rows appended to temporary table.&amp;nbsp; List deleted."

&amp;nbsp;&amp;nbsp;&amp;nbsp; #remove duplicates from list
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = dict.fromkeys(list)
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = list.keys()

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Duplicates removed."

&amp;nbsp;&amp;nbsp;&amp;nbsp; #create a temporary memory variable
&amp;nbsp;&amp;nbsp;&amp;nbsp; memoryFC = "in_memory" + "\\" + "virtualFC"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Memory Feature created."

&amp;nbsp;&amp;nbsp;&amp;nbsp; for n in list:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.TableSelect_analysis(infc, memoryFC, "STA_calc = " + str(n))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Seg = fields[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_STA = fields[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_name = n
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_pdf = r"\XS\Script\XS_chart_Seg" + str(out_Seg) + str(out_STA) + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph_data = memoryFC

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create temporary feature layer 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(infc, "XS_lyr")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the graph from temporary feature layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph = arcpy.Graph()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the title of the Graph
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphPropsGeneral.title = "Segment " + out_Seg

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the subtitle of the Graph
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphPropsGeneral.subtitle = "Station " + out_STA

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the title of the left axis
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphAxis[0].title = "Elevation (ft)"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the title of the bottom axis
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphAxis[2].title = "Station (ft)"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Add a vertical bar series to the graph
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.addSeriesLineVertical("XS_lyr", shape.Z, shape.M)

&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeGraph_management(graph_template, graph, out_graph_name)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the graph as an PDF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveGraph_management(out_graph_name, out_graph_pdf, "MAINTAIN_ASPECT_RATIO", 800, 600)

&amp;nbsp;&amp;nbsp;&amp;nbsp; #clean in-memory
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management("in_memory")

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "PDFs created and memory cleaned."&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get an error in line 82 where I am adding the vertical line series. I assume the problem is that I am trying to plot values based on feature geometry as opposed to values in the attribute table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The source data is a polyline feature class with Z and M values in an Arc 10.0 SP4 file geodatabase.&amp;nbsp; The features display properly in ArcScene based on their own elevation values and I'm able to locate other features along the lines (routes), so I'm pretty sure the Z and M geometry is solid.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is what I'm attempting possible without some intermediate conversion (e.g. converting vertices to points)?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank-you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS.&amp;nbsp; I'm also trying to get chart titles and subtitles to dynamically update, but haven't gotten to testing that yet.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:07:44 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-10T21:07:44Z</dc:date>
    <item>
      <title>using Z and M feature geometry to create line graph in Python?</title>
      <link>https://community.esri.com/t5/transportation-questions/using-z-and-m-feature-geometry-to-create-line/m-p/27928#M113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: willfish&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, I am a Python (v2.6.5) noob trying to plot a series of 3D polylines into graphs. So far I've come up with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Import system modules
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy, os, sys, string
&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy import env

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Modules imported."

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set environment settings
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = r"X:\HaulRoad\SpatialData"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.scratchWorkspace = r"X:\HaulRoad\SpatialData"

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Workspaces set."

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set local variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; infc = "\HaulRd.gdb\Treatment\XS_2009BEBRklnTerr_interpZ_Rte_isect"
&amp;nbsp;&amp;nbsp;&amp;nbsp; graph_template = r"\XS\XS_Seg02.55.grf"&amp;nbsp; # template graph originally created with 3d Analyst profile tool, customized in Advanced Properties, then exported to grf format

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Local variables set."


&amp;nbsp;&amp;nbsp;&amp;nbsp; #create list of fields of interest from FC or table of interest
&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = ['SegID','STA_calc','shape.Z','shape.M']


&amp;nbsp;&amp;nbsp;&amp;nbsp; #create empty list for cursor to populate
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = []

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Table and empty list created."

&amp;nbsp;&amp;nbsp;&amp;nbsp; # use search cursor to get field value for a given record 
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(infc, "", "", "SegID; STA_calc")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row.SegID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row.STA_calc)

&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, rows

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Rows appended to temporary table.&amp;nbsp; List deleted."

&amp;nbsp;&amp;nbsp;&amp;nbsp; #remove duplicates from list
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = dict.fromkeys(list)
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = list.keys()

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Duplicates removed."

&amp;nbsp;&amp;nbsp;&amp;nbsp; #create a temporary memory variable
&amp;nbsp;&amp;nbsp;&amp;nbsp; memoryFC = "in_memory" + "\\" + "virtualFC"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Memory Feature created."

&amp;nbsp;&amp;nbsp;&amp;nbsp; for n in list:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.TableSelect_analysis(infc, memoryFC, "STA_calc = " + str(n))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_Seg = fields[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_STA = fields[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_name = n
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_graph_pdf = r"\XS\Script\XS_chart_Seg" + str(out_Seg) + str(out_STA) + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph_data = memoryFC

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create temporary feature layer 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(infc, "XS_lyr")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the graph from temporary feature layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph = arcpy.Graph()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the title of the Graph
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphPropsGeneral.title = "Segment " + out_Seg

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the subtitle of the Graph
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphPropsGeneral.subtitle = "Station " + out_STA

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the title of the left axis
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphAxis[0].title = "Elevation (ft)"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Specify the title of the bottom axis
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.graphAxis[2].title = "Station (ft)"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Add a vertical bar series to the graph
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graph.addSeriesLineVertical("XS_lyr", shape.Z, shape.M)

&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeGraph_management(graph_template, graph, out_graph_name)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the graph as an PDF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveGraph_management(out_graph_name, out_graph_pdf, "MAINTAIN_ASPECT_RATIO", 800, 600)

&amp;nbsp;&amp;nbsp;&amp;nbsp; #clean in-memory
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management("in_memory")

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "PDFs created and memory cleaned."&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get an error in line 82 where I am adding the vertical line series. I assume the problem is that I am trying to plot values based on feature geometry as opposed to values in the attribute table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The source data is a polyline feature class with Z and M values in an Arc 10.0 SP4 file geodatabase.&amp;nbsp; The features display properly in ArcScene based on their own elevation values and I'm able to locate other features along the lines (routes), so I'm pretty sure the Z and M geometry is solid.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is what I'm attempting possible without some intermediate conversion (e.g. converting vertices to points)?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank-you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS.&amp;nbsp; I'm also trying to get chart titles and subtitles to dynamically update, but haven't gotten to testing that yet.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/using-z-and-m-feature-geometry-to-create-line/m-p/27928#M113</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T21:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: using Z and M feature geometry to create line graph in Python?</title>
      <link>https://community.esri.com/t5/transportation-questions/using-z-and-m-feature-geometry-to-create-line/m-p/27929#M114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Will,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as I can see it is not possible to do this using the interface of ArcGIS. This normally means that you won't be able to do so using Python code. The easiest way would be to add the M and Z values as attribute. This way you can still use your code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another possibility is to use matplotlib (pyplot), but this requires an additional installation (&lt;/SPAN&gt;&lt;A href="http://matplotlib.org/downloads.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://matplotlib.org/downloads.html&lt;/A&gt;&lt;SPAN&gt;, which is free). To give you an idea of how the code would look, see the (simplified) sample below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
import matplotlib.pyplot as plt
from arcpy import env

infc = "\HaulRd.gdb\Treatment\XS_2009BEBRklnTerr_interpZ_Rte_isect"
flds = ('SHAPE@Z','SHAPE@M')

x = [] # Z
y = [] # M
outFolder = r'C:\path\to\output\folder'
outFile = os.path.join(outFolder, "NameForThisProfile.png")

fig = plt.figure(figsize=(10, 5)) # size in inches

with arcpy.da.SearchCursor(infc, flds) as rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x.append(row[0]) # Z
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y.append(row[1]) # M
plt.plot(x,y,'r',linewidth=1.0)
plt.plot(x,y,'ro',alpha=0.5)
plt.xlabel('x label text')
plt.ylabel('y label text')
plt.title('Give the graph a title')
fig.savefig(outFile, dpi=300)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:07:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/using-z-and-m-feature-geometry-to-create-line/m-p/27929#M114</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T21:07:47Z</dc:date>
    </item>
  </channel>
</rss>

