Graphing vertical lines

633
3
04-07-2017 10:38 AM
PattyVogel
New Contributor

I'm creating a vertical line graph of data that was collected at various station points along a pipeline. In some of the areas, there are null values for the data at a particular station or multiple stations. I would like the vertical line to stop at the null points, and continue again when there is data. (like a dashed line) Currently, the null valued data is being ignored, and a line is being drawn from the last point with data to the next point with data. I have looked all through the advanced properties of the graph, and can't find anything that will do what I need. I don't what to have to create multiple series within the graph to create this broken line.

Does anyone know how to accomplish what I need? I've attached a picture of what I need it to look like.

thanks in advance!

Tags (1)
0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

You have to treat each break in the dataset as a new pair of data. So split your data where a null value occurs and treat it as a pair.  Implementing this depends on the format of the data of course

0 Kudos
PattyVogel
New Contributor

Thanks. That's exactly what I was hoping I didn't have to do. I just can't believe that when you create a graph, it doesn't recognize null values in data.

0 Kudos
DanPatterson_Retired
MVP Emeritus

of course you don't have to stick with arcmap, since matplotlib is builtin.

import matplotlib.pyplot as plt
x = np.arange(10)
y = [ 1, 1, 1, 1.25, None, 1.5, 1.25, 1, 1, 1]
plt.plot(x, y, linestyle='-', marker='o')
 [<matplotlib.lines.Line2D at 0x17de70d9ac8>]

plt.show()

yields