Commit d7c7e4e9 authored by Katharina Przybill's avatar Katharina Przybill
Browse files

Upload New File

parent 93985c8b
# -*- coding: utf-8 -*-
#!/usr/bin/python2.7
import psycopg2
from pylab import *
import matplotlib
import psycopg2
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
equ_first_list = []
equ_dev_list = []
with open("D:\\katha\\filter\\equidistance\\unclipped\\equ_stg.txt") as f:
for line in f.readlines():
line = line.split(";")
if len(line) > 0:
equ_first = line[0].replace(",",".")
equ_first = float(equ_first)
equ_first_list.append(equ_first)
equ_dev = line[1].replace(",",".")
equ_dev = float(equ_dev)
equ_dev_list.append(equ_dev)
col1 = equ_first_list #
devel_equ = equ_dev_list #
# improvement of equidistance average
equ_av = sum(equ_dev_list)/len(equ_dev_list)
# not changed polygons
poly_unchanged = (100.0/len(equ_dev_list))* (equ_dev_list.count(0.0))
# improvement of geometric representation of polygons
print equ_av
print poly_unchanged
###
### Plot (Line-Chart)
###
fig, ax = plt.subplots()
# Create linechart
plt.plot(devel_equ, color = '#ff6700', linewidth=2, label='Development of the Equidistance')
# Place a gray dashed grid behind the thicks (only for y-axis)
ax.xaxis.grid(color='gray', linestyle='dashed')
ax.yaxis.grid(color='gray', linestyle='dashed')
# Set this grid behind the thicks
ax.set_axisbelow(True)
# Rotate x-labels on the x-axis
fig.autofmt_xdate()
# Label x and y axis
x_str = ('Polygons with a "natural" or "landuse"-Tag')
plt.xlabel(x_str)
plt.ylabel('Change of Equidistance [m]')
# place legend
ax.legend(loc='upper center', prop={'size':12})
# Plot-title
plt.title('Equidistance Development of Polygons with "natural" or "landuse"-Tag"')
# Save plot to *.jpeg-file
plt.savefig('D:\\katha\\filter\\diagramme\\equidist_stg.jpeg')
plt.clf()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment