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

Upload New .py File to make a polarplot

parent 5503fa08
# -*- 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
dist_lilst = []
angle_list = []
with open("D:\\katha\\filter\\junctions_tabellen\\lucknow_junct_py.txt") as f:
for line in f.readlines():
line = line.split(";")
dist = line[0]
dist = float(dist)
dist_lilst.append(dist)
angle = line[1]
angle = float(angle)
angle_list.append(angle)
col1 = dist_lilst# Distance between two junctions
col2 = angle_list# Degree of Distance
###
### Plot (Scatter-Plot)
###
ax = subplot(111, polar=True)
# Scatterplot: degree in Polar-Scatter (degree between different junctions), y-axis in Scatter (length betweeen different junctions), color, size of circles, color-map:
c = scatter(col2, col1, c=col1, s=100, cmap=cm.hsv)
# Set Opacity of circles
c.set_alpha(0.75)
# Plot-title
plt.title("Directional Scatterplot of Degree and Distance [m] between two Junctions")
# Save plot to *.png-file
plt.savefig('D:\\katha\\filter\\diagrame\\junctions_luc.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