Skip to content

Instantly share code, notes, and snippets.

@takehaya
Created December 8, 2019 23:21
Show Gist options
  • Save takehaya/3b44edc35c6ff974e1bc43ac8e2f8149 to your computer and use it in GitHub Desktop.
Save takehaya/3b44edc35c6ff974e1bc43ac8e2f8149 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
import math
ax = plt.subplot(111, polar=True)
ax.set_theta_direction(-1)
ax.set_theta_zero_location("W")
xalx = [
113.4, 113.1 ,113.7, 116.7, 117.4, 117.8, 114.8, 119.2, 125.1,
123.2, 121.2, 117.4, 114.9, 111.7, 104.3, 108.6, 107.1, 105.5,
107.0, 108.2, 109.4, 111.6, 107.0, 116.4, 114.1, 126.5, 123.7,
122.1, 119.2, 114.7, 113.1, 111.2, 110.2, 108.8, 114.5, 113.3,
]
# 126.5:250
# 123.5,
# 126.5-114.1:10 = 3:x -> 2.41935484
# 30/12.4
# 250-2.41935484
# 126
# 126.5-122.1:20 = 3:x -> 13.6363636
# 60/126.5-122.1
xalx.append(xalx[0])
pipi2_range = [i/ 180 * np.pi for i in range(0, 370, 10)]
print(pipi2_range)
lineol = [0,126.5]
lineay = [247.580645 / 180 * np.pi]*2
lineby = [263.6363636 / 180 * np.pi]*2
print(263.6363636 - 247.580645)
ax.plot(lineay, lineol, "blue")
ax.plot(lineby, lineol, "blue")
# これを有効にすると点を打つことができる(が普通はいらなそう
for i, e in zip(pipi2_range, xalx):
ax.plot(i, e, "ro")
ax.plot(pipi2_range, xalx, label="Experiment1")
yalx = [
100.0, 101.3, 103.6, 108.8, 121.7, 117.8, 113.1, 120.6, 122.1,
130.1, 121.4, 125.9, 122.8, 118.1, 114.9, 116.3, 117.8, 118.4,
121.2, 120.1, 113.4, 116.8, 114.5, 115.4, 121.0, 117.2, 117.5,
118.5, 123.5, 124.5, 122.5, 119.5, 122.5, 115.0, 109.5, 100.0,
]
# 130.1:90
# 127
# 127-122.1:10 = 3:x -> 2.41935484
# 30/4.9 -> 6.13
# 127-122.4:10 = 3:x ->
# 30/ 4.6 -> 6.52
# 96.52, 83.87
yalx.append(yalx[0])
lineol = [0,130.1]
lineay = [83.87/ 180 * np.pi]*2
lineby = [96.52/ 180 * np.pi]*2
print(96.52 - 83.87)
ax.plot(lineay, lineol, "green")
ax.plot(lineby, lineol, "green")
ax.plot(pipi2_range, yalx, label="Experiment2")
for i, e in zip(pipi2_range, yalx):
ax.plot(i, e, "yo")
ax.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment