25 lines
3.4 KiB
Python
25 lines
3.4 KiB
Python
import matplotlib.pyplot as plt
|
|
|
|
|
|
def convert(text):
|
|
points = text.split("L")
|
|
result = []
|
|
max_y = 0
|
|
min_y = 1000000
|
|
for point in points:
|
|
x, y = point.split(",")
|
|
x = int(float(x))
|
|
y = int(float(y))
|
|
if y > max_y:
|
|
max_y = y
|
|
if y < min_y:
|
|
min_y = y
|
|
result.append([x, y])
|
|
print(result)
|
|
# print([row[1] for row in result])
|
|
plt.plot([row[0] for row in result], [max_y - row[1] + min_y for row in result])
|
|
plt.show()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
convert("25,35.67999999999999L35.07070707070707,60.08L45.141414141414145,60.08L55.21212121212121,60.08L65.28282828282829,21.999999999999993L75.35353535353535,21.999999999999993L85.42424242424242,21.999999999999993L95.49494949494948,21.999999999999993L105.56565656565657,50L115.63636363636363,50L125.7070707070707,27.200000000000003L135.77777777777777,27.200000000000003L145.84848484848484,76L155.91919191919192,50.23999999999999L165.98989898989896,50.23999999999999L176.06060606060606,50.23999999999999L186.13131313131314,50.23999999999999L196.20202020202018,58.16000000000001L206.27272727272725,54.00000000000001L216.34343434343432,41.99999999999999L226.4141414141414,41.99999999999999L236.48484848484847,66.72000000000001L246.55555555555554,55.44000000000001L256.6262626262626,64.48L266.6969696969697,80.08L276.7676767676768,66.08000000000001L286.83838383838383,76L296.9090909090909,30L306.9797979797979,70L317.050505050505,70L327.1212121212121,47.599999999999994L337.19191919191917,68.64L347.26262626262627,68.64L357.3333333333333,68.64L367.40404040404036,72.32L377.47474747474746,70L387.54545454545456,70L397.6161616161616,66.48L407.68686868686865,71.92L417.7575757575757,80.8L427.8282828282828,80.8L437.8989898989899,78.32000000000001L447.96969696969694,52.400000000000006L458.04040404040404,58.32000000000001L468.1111111111111,58.32000000000001L478.18181818181813,58.96000000000001L488.25252525252523,79.67999999999999L498.3232323232323,78.08L508.3939393939394,78.08L518.4646464646464,66L528.5353535353536,74.08L538.6060606060606,74.08L548.6767676767677,74.08L558.7474747474748,74.08L568.8181818181818,70L578.8888888888889,58.88L588.959595959596,74.88L599.0303030303031,81.92L609.10101010101,53.52L619.1717171717171,58.96000000000001L629.2424242424242,67.36000000000001L639.3131313131313,71.12L649.3838383838383,67.68L659.4545454545455,73.91999999999999L669.5252525252525,80.08L679.5959595959596,77.60000000000001L689.6666666666666,87.2L699.7373737373738,70.48L709.8080808080807,80.88L719.878787878788,88.96000000000001L729.9494949494949,78.88L740.020202020202,78.88L750.0909090909091,68.08L760.1616161616162,98.00000000000001L770.2323232323232,94L780.3030303030303,94L790.3737373737373,80.55999999999999L800.4444444444445,86.32000000000001L810.5151515151514,81.52L820.5858585858587,85.92L830.6565656565656,109.28000000000002L840.7272727272727,123.76000000000002L850.7979797979798,125.76L860.8686868686868,125.36L870.9393939393939,124.80000000000001L881.010101010101,125.03999999999999L891.0808080808081,124.72000000000001L901.1515151515151,126.4L911.2222222222222,126.72L921.2929292929293,124.80000000000001L931.3636363636363,127.12L941.4343434343434,126.72L951.5050505050505,126.47999999999999L961.5757575757576,127.52L971.6464646464646,127.68L981.7171717171717,128.56L991.7878787878788,131.6L1001.8585858585858,134.88L1011.929292929293,137.27999999999997L1022,137.35999999999999") |