我创建了以下代码:
#!/usr/bin/env python
import json
import matplotlib.pyplot as plt
from matplotlib.widgets import CheckButtons
from matplotlib.widgets import Button, Slider
def submit_form(event):
"""Send the status of the form to the server."""
print(event)
def visualize(a, b):
"""Visualize datasets a and b."""
# Make sure that the screen size of one unit is the same on both axes
fig = plt.figure(1, figsize=(8, 8))
for i, data in enumerate([a, b]):
# new subplot for new data
ax = fig.add_subplot(1, 2, i+1)
ax.set_aspect(1)
# Set plot size
ax.axis((0, 400, 0, 400))
# prepare data for a
for line in data:
xs, ys = [], []
for p in line:
xs.append(p['x'])
ys.append(p['y'])
# Invert y axis as data was recorded with HTML5 canvas
plt.gca().invert_yaxis()
# plot data
plt.plot(xs, ys, '-o')
# maximise height
mng = plt.get_current_fig_manager()
width, height = mng.window.maxsize()
mng.resize(500, height)
# Add widgets:
# Wild point Slider
axcolor = 'lightgoldenrodyellow'
axfreq = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
wild_point_slider = Slider(axfreq,
'Wild points',
0, 15, valinit=3,
valfmt='%0.0f')
# Improvement
rax = plt.axes([0.05, 0.15, 0.5, 0.18])
check = CheckButtons(rax,
('Algorithm improved image', 'Other problem'),
(False, True, True))
# submit Button
axnext = plt.axes([0.7, 0.18, 0.2, 0.05])
submit = Button(axnext, 'Submit')
submit.on_clicked(submit_form)
plt.show()
if __name__ == '__main__':
a = """[[{"x":31.5854313228,"y":79.130434782609,"time":0},{"x":28.759344366278,"y":81.95652173913,"time":48},{"x":25.933257409757,"y":87.608695652174,"time":64},{"x":23.107170453235,"y":87.608695652174,"time":71},{"x":23.107170453235,"y":90.434782608696,"time":80},{"x":20.281083496713,"y":93.260869565217,"time":88},{"x":20.281083496713,"y":96.086956521739,"time":96},{"x":17.454996540191,"y":98.913043478261,"time":104},{"x":14.62890958367,"y":101.73913043478,"time":111},{"x":14.62890958367,"y":104.5652173913,"time":119},{"x":14.62890958367,"y":110.21739130435,"time":128},{"x":11.802822627148,"y":113.04347826087,"time":144},{"x":11.802822627148,"y":115.86956521739,"time":152},{"x":8.9767356706262,"y":121.52173913043,"time":160},{"x":8.9767356706262,"y":124.34782608696,"time":176},{"x":8.9767356706262,"y":127.17391304348,"time":184},{"x":8.9767356706262,"y":130,"time":200},{"x":6.1506487141045,"y":132.82608695652,"time":208},{"x":3.3245617575827,"y":138.47826086957,"time":216},{"x":3.3245617575827,"y":141.30434782609,"time":224},{"x":3.3245617575827,"y":144.13043478261,"time":232},{"x":3.3245617575827,"y":146.95652173913,"time":239},{"x":0.49847480106101,"y":149.78260869565,"time":248},{"x":0.49847480106101,"y":152.60869565217,"time":256},{"x":0.49847480106101,"y":158.26086956522,"time":273},{"x":0.49847480106101,"y":161.08695652174,"time":280},{"x":0.49847480106101,"y":166.73913043478,"time":288},{"x":0.49847480106101,"y":169.5652173913,"time":296},{"x":0.49847480106101,"y":175.21739130435,"time":312},{"x":0.49847480106101,"y":178.04347826087,"time":319},{"x":0.49847480106101,"y":180.86956521739,"time":327},{"x":0.49847480106101,"y":183.69565217391,"time":336},{"x":0.49847480106101,"y":186.52173913043,"time":344},{"x":0.49847480106101,"y":189.34782608696,"time":360},{"x":0.49847480106101,"y":195,"time":368},{"x":0.49847480106101,"y":200.65217391304,"time":374},{"x":0.49847480106101,"y":203.47826086957,"time":381},{"x":0.49847480106101,"y":206.30434782609,"time":387},{"x":0.49847480106101,"y":211.95652173913,"time":395},{"x":0.49847480106101,"y":217.60869565217,"time":401},{"x":0.49847480106101,"y":220.4347826087,"time":408},{"x":0.49847480106101,"y":226.08695652174,"time":416},{"x":0.49847480106101,"y":231.73913043478,"time":424},{"x":0.49847480106101,"y":237.39130434783,"time":432},{"x":3.3245617575827,"y":243.04347826087,"time":440},{"x":6.1506487141045,"y":248.69565217391,"time":447},{"x":6.1506487141045,"y":254.34782608696,"time":456},{"x":8.9767356706262,"y":262.82608695652,"time":464},{"x":14.62890958367,"y":268.47826086957,"time":472},{"x":14.62890958367,"y":274.13043478261,"time":482},{"x":20.281083496713,"y":282.60869565217,"time":487},{"x":25.933257409757,"y":293.91304347826,"time":496},{"x":25.933257409757,"y":299.5652173913,"time":505},{"x":28.759344366278,"y":305.21739130435,"time":512},{"x":34.411518279322,"y":313.69565217391,"time":520},{"x":37.237605235844,"y":319.34782608696,"time":529},{"x":42.889779148887,"y":330.65217391304,"time":536},{"x":45.715866105409,"y":336.30434782609,"time":544},{"x":57.020213931496,"y":347.60869565217,"time":553},{"x":59.846300888018,"y":353.26086956522,"time":561},{"x":65.498474801061,"y":358.91304347826,"time":568},{"x":71.150648714104,"y":361.73913043478,"time":577},{"x":76.802822627148,"y":370.21739130435,"time":584},{"x":82.454996540191,"y":373.04347826087,"time":594},{"x":85.281083496713,"y":378.69565217391,"time":602},{"x":88.107170453235,"y":378.69565217391,"time":611},{"x":96.5854313228,"y":384.34782608696,"time":617},{"x":99.411518279322,"y":387.17391304348,"time":632},{"x":107.88977914889,"y":390,"time":640},{"x":110.71586610541,"y":390,"time":655},{"x":113.54195306193,"y":390,"time":664},{"x":119.19412697497,"y":390,"time":672},{"x":122.0202139315,"y":390,"time":680},{"x":124.84630088802,"y":390,"time":688},{"x":133.32456175758,"y":390,"time":697},{"x":136.1506487141,"y":390,"time":704},{"x":141.80282262715,"y":390,"time":712},{"x":147.45499654019,"y":390,"time":720},{"x":150.28108349671,"y":390,"time":729},{"x":158.75934436628,"y":384.34782608696,"time":736},{"x":175.71586610541,"y":375.86956521739,"time":763},{"x":184.19412697497,"y":370.21739130435,"time":771},{"x":189.84630088802,"y":364.5652173913,"time":789},{"x":192.67238784454,"y":361.73913043478,"time":800},{"x":195.49847480106,"y":361.73913043478,"time":811},{"x":198.32456175758,"y":356.08695652174,"time":821},{"x":201.1506487141,"y":353.26086956522,"time":832},{"x":203.97673567063,"y":350.4347826087,"time":841},{"x":206.80282262715,"y":347.60869565217,"time":849},{"x":209.62890958367,"y":344.78260869565,"time":863},{"x":212.45499654019,"y":339.13043478261,"time":874},{"x":212.45499654019,"y":336.30434782609,"time":882},{"x":215.28108349671,"y":330.65217391304,"time":892},{"x":215.28108349671,"y":327.82608695652,"time":902},{"x":215.28108349671,"y":325,"time":911},{"x":215.28108349671,"y":316.52173913043,"time":923},{"x":215.28108349671,"y":310.86956521739,"time":933},{"x":218.10717045323,"y":308.04347826087,"time":943},{"x":218.10717045323,"y":302.39130434783,"time":953},{"x":220.93325740976,"y":296.73913043478,"time":961},{"x":220.93325740976,"y":291.08695652174,"time":972},{"x":220.93325740976,"y":285.4347826087,"time":981},{"x":220.93325740976,"y":282.60869565217,"time":990},{"x":220.93325740976,"y":276.95652173913,"time":1001},{"x":223.75934436628,"y":265.65217391304,"time":1012},{"x":223.75934436628,"y":260,"time":1021},{"x":223.75934436628,"y":254.34782608696,"time":1030},{"x":223.75934436628,"y":245.86956521739,"time":1039},{"x":223.75934436628,"y":243.04347826087,"time":1049},{"x":223.75934436628,"y":240.21739130435,"time":1058},{"x":223.75934436628,"y":228.91304347826,"time":1069},{"x":223.75934436628,"y":223.26086956522,"time":1078},{"x":223.75934436628,"y":217.60869565217,"time":1088},{"x":223.75934436628,"y":211.95652173913,"time":1097},{"x":223.75934436628,"y":197.82608695652,"time":1107},{"x":223.75934436628,"y":189.34782608696,"time":1117},{"x":223.75934436628,"y":180.86956521739,"time":1126},{"x":220.93325740976,"y":172.39130434783,"time":1137},{"x":218.10717045323,"y":169.5652173913,"time":1145},{"x":212.45499654019,"y":158.26086956522,"time":1155},{"x":212.45499654019,"y":152.60869565217,"time":1165},{"x":206.80282262715,"y":146.95652173913,"time":1175},{"x":201.1506487141,"y":141.30434782609,"time":1195},{"x":198.32456175758,"y":135.65217391304,"time":1205},{"x":195.49847480106,"y":135.65217391304,"time":1218},{"x":192.67238784454,"y":130,"time":1228},{"x":189.84630088802,"y":127.17391304348,"time":1237},{"x":184.19412697497,"y":121.52173913043,"time":1250},{"x":181.36804001845,"y":118.69565217391,"time":1260},{"x":178.54195306193,"y":115.86956521739,"time":1271},{"x":178.54195306193,"y":113.04347826087,"time":1283},{"x":172.88977914889,"y":107.39130434783,"time":1294},{"x":172.88977914889,"y":104.5652173913,"time":1311},{"x":164.41151827932,"y":98.913043478261,"time":1321},{"x":155.93325740976,"y":96.086956521739,"time":1332},{"x":150.28108349671,"y":90.434782608696,"time":1343},{"x":147.45499654019,"y":90.434782608696,"time":1355},{"x":144.62890958367,"y":87.608695652174,"time":1365},{"x":141.80282262715,"y":84.782608695652,"time":1377},{"x":136.1506487141,"y":81.95652173913,"time":1387},{"x":133.32456175758,"y":79.130434782609,"time":1397},{"x":130.49847480106,"y":79.130434782609,"time":1406},{"x":127.67238784454,"y":76.304347826087,"time":1420},{"x":122.0202139315,"y":73.478260869565,"time":1434},{"x":119.19412697497,"y":70.652173913043,"time":1456},{"x":116.36804001845,"y":70.652173913043,"time":1473},{"x":116.36804001845,"y":67.826086956522,"time":1483},{"x":110.71586610541,"y":67.826086956522,"time":1494},{"x":110.71586610541,"y":65,"time":1506},{"x":107.88977914889,"y":65,"time":1516},{"x":105.06369219237,"y":62.173913043478,"time":1538},{"x":102.23760523584,"y":62.173913043478,"time":1560},{"x":99.411518279322,"y":62.173913043478,"time":1569},{"x":99.411518279322,"y":59.347826086957,"time":1579},{"x":96.5854313228,"y":59.347826086957,"time":1589},{"x":90.933257409757,"y":56.521739130435,"time":1601},{"x":88.107170453235,"y":56.521739130435,"time":1617},{"x":85.281083496713,"y":56.521739130435,"time":1632},{"x":82.454996540191,"y":53.695652173913,"time":1642},{"x":79.62890958367,"y":53.695652173913,"time":1656},{"x":76.802822627148,"y":53.695652173913,"time":1666},{"x":73.976735670626,"y":53.695652173913,"time":1678},{"x":71.150648714104,"y":53.695652173913,"time":1689},{"x":68.324561757583,"y":53.695652173913,"time":1704},{"x":65.498474801061,"y":53.695652173913,"time":1720},{"x":62.672387844539,"y":53.695652173913,"time":1730},{"x":59.846300888018,"y":53.695652173913,"time":1744},{"x":57.020213931496,"y":53.695652173913,"time":1768},{"x":54.194126974974,"y":53.695652173913,"time":1801},{"x":51.368040018452,"y":53.695652173913,"time":1817},{"x":48.541953061931,"y":53.695652173913,"time":1840},{"x":48.541953061931,"y":56.521739130435,"time":1857},{"x":45.715866105409,"y":56.521739130435,"time":1865},{"x":42.889779148887,"y":56.521739130435,"time":1889},{"x":42.889779148887,"y":59.347826086957,"time":1904},{"x":40.063692192365,"y":59.347826086957,"time":1913},{"x":37.237605235844,"y":59.347826086957,"time":1925},{"x":37.237605235844,"y":62.173913043478,"time":1944},{"x":34.411518279322,"y":62.173913043478,"time":1954},{"x":34.411518279322,"y":65,"time":1968},{"x":31.5854313228,"y":65,"time":1992},{"x":31.5854313228,"y":67.826086956522,"time":2016},{"x":28.759344366278,"y":67.826086956522,"time":2032},{"x":28.759344366278,"y":70.652173913043,"time":2065},{"x":28.759344366278,"y":73.478260869565,"time":2075},{"x":28.759344366278,"y":76.304347826087,"time":2096},{"x":28.759344366278,"y":79.130434782609,"time":2137},{"x":31.5854313228,"y":79.130434782609,"time":2152},{"x":34.411518279322,"y":79.130434782609,"time":2216},{"x":37.237605235844,"y":79.130434782609,"time":2241},{"x":42.889779148887,"y":76.304347826087,"time":2256},{"x":42.889779148887,"y":73.478260869565,"time":2272},{"x":45.715866105409,"y":73.478260869565,"time":2286},{"x":45.715866105409,"y":70.652173913043,"time":2297},{"x":54.194126974974,"y":62.173913043478,"time":2308},{"x":59.846300888018,"y":62.173913043478,"time":2319},{"x":62.672387844539,"y":56.521739130435,"time":2335},{"x":71.150648714104,"y":50.869565217391,"time":2347},{"x":73.976735670626,"y":50.869565217391,"time":2359},{"x":85.281083496713,"y":45.217391304348,"time":2370},{"x":90.933257409757,"y":45.217391304348,"time":2382},{"x":93.759344366278,"y":42.391304347826,"time":2395},{"x":110.71586610541,"y":36.739130434783,"time":2408},{"x":138.97673567063,"y":33.913043478261,"time":2438},{"x":153.10717045323,"y":31.086956521739,"time":2453},{"x":158.75934436628,"y":31.086956521739,"time":2465},{"x":170.06369219237,"y":31.086956521739,"time":2478},{"x":178.54195306193,"y":28.260869565217,"time":2489},{"x":192.67238784454,"y":25.434782608696,"time":2501},{"x":198.32456175758,"y":25.434782608696,"time":2514},{"x":209.62890958367,"y":22.608695652174,"time":2527},{"x":223.75934436628,"y":22.608695652174,"time":2538},{"x":232.23760523584,"y":19.782608695652,"time":2549},{"x":240.71586610541,"y":19.782608695652,"time":2562},{"x":249.19412697497,"y":16.95652173913,"time":2572},{"x":263.32456175758,"y":14.130434782609,"time":2584},{"x":274.62890958367,"y":11.304347826087,"time":2595},{"x":280.28108349671,"y":11.304347826087,"time":2608},{"x":294.41151827932,"y":8.4782608695652,"time":2619},{"x":300.06369219237,"y":8.4782608695652,"time":2632},{"x":308.54195306193,"y":5.6521739130435,"time":2644},{"x":319.84630088802,"y":2.8260869565217,"time":2659},{"x":322.67238784454,"y":2.8260869565217,"time":2673},{"x":328.32456175758,"y":0,"time":2685}]]"""
b = """[[{"x":0.49715324046033,"y":0,"time":0},{"x":0.49715324046033,"y":1.3829787234043,"time":42},{"x":0.49715324046033,"y":15.212765957447,"time":87},{"x":0.49715324046033,"y":26.276595744681,"time":102},{"x":0.49715324046033,"y":34.574468085106,"time":107},{"x":0.49715324046033,"y":65,"time":124},{"x":0.49715324046033,"y":98.191489361702,"time":140},{"x":0.49715324046033,"y":135.53191489362,"time":157},{"x":0.49715324046033,"y":153.51063829787,"time":161},{"x":0.49715324046033,"y":172.87234042553,"time":174},{"x":0.49715324046033,"y":193.6170212766,"time":179},{"x":3.2631106872688,"y":232.34042553191,"time":195},{"x":6.0290681340773,"y":265.53191489362,"time":210},{"x":6.0290681340773,"y":298.72340425532,"time":228},{"x":8.7950255808859,"y":333.29787234043,"time":244},{"x":11.560983027694,"y":348.51063829787,"time":250},{"x":15.709919197907,"y":360.95744680851,"time":264},{"x":18.475876644716,"y":369.25531914894,"time":265},{"x":18.475876644716,"y":376.17021276596,"time":281},{"x":19.85885536812,"y":380.31914893617,"time":285},{"x":21.241834091524,"y":384.46808510638,"time":301},{"x":24.007791538333,"y":387.23404255319,"time":322},{"x":29.53970643195,"y":388.6170212766,"time":337},{"x":33.688642602162,"y":390,"time":352},{"x":36.454600048971,"y":390,"time":356},{"x":43.369493665992,"y":390,"time":370},{"x":50.284387283014,"y":388.6170212766,"time":386},{"x":58.582259623439,"y":385.85106382979,"time":402},{"x":64.114174517056,"y":383.08510638298,"time":418},{"x":66.880131963865,"y":380.31914893617,"time":435},{"x":72.412046857482,"y":377.55319148936,"time":454},{"x":76.560983027694,"y":374.78723404255,"time":459},{"x":82.092897921311,"y":372.02127659574,"time":474},{"x":84.85885536812,"y":370.63829787234,"time":488},{"x":87.624812814928,"y":367.87234042553,"time":490},{"x":91.773748985141,"y":365.10638297872,"time":504},{"x":94.53970643195,"y":363.72340425532,"time":506},{"x":97.305663878758,"y":360.95744680851,"time":523},{"x":102.83757877238,"y":356.8085106383,"time":541},{"x":109.7524723894,"y":352.65957446809,"time":556},{"x":113.90140855961,"y":349.89361702128,"time":563},{"x":119.43332345323,"y":342.97872340426,"time":579},{"x":124.96523834684,"y":337.44680851064,"time":597},{"x":127.73119579365,"y":333.29787234043,"time":602},{"x":130.49715324046,"y":327.76595744681,"time":623},{"x":134.64608941067,"y":325,"time":626},{"x":137.41204685748,"y":320.85106382979,"time":634},{"x":144.3269404745,"y":313.93617021277,"time":659},{"x":147.09289792131,"y":309.78723404255,"time":674},{"x":147.09289792131,"y":308.40425531915,"time":681},{"x":160.92268515535,"y":269.68085106383,"time":787},{"x":162.30566387876,"y":262.76595744681,"time":803},{"x":162.30566387876,"y":257.23404255319,"time":823},{"x":163.68864260216,"y":254.46808510638,"time":829},{"x":163.68864260216,"y":250.31914893617,"time":833},{"x":163.68864260216,"y":246.17021276596,"time":841},{"x":163.68864260216,"y":240.63829787234,"time":849},{"x":165.07162132557,"y":236.48936170213,"time":863},{"x":165.07162132557,"y":230.95744680851,"time":868},{"x":166.45460004897,"y":224.04255319149,"time":876},{"x":167.83757877238,"y":221.27659574468,"time":882},{"x":167.83757877238,"y":217.12765957447,"time":892},{"x":167.83757877238,"y":212.97872340426,"time":897},{"x":167.83757877238,"y":210.21276595745,"time":905},{"x":167.83757877238,"y":206.06382978723,"time":913},{"x":167.83757877238,"y":199.14893617021,"time":934},{"x":167.83757877238,"y":196.3829787234,"time":937},{"x":167.83757877238,"y":193.6170212766,"time":947},{"x":167.83757877238,"y":190.85106382979,"time":953},{"x":166.45460004897,"y":188.08510638298,"time":961},{"x":166.45460004897,"y":185.31914893617,"time":970},{"x":166.45460004897,"y":182.55319148936,"time":981},{"x":167.83757877238,"y":181.17021276596,"time":991},{"x":167.83757877238,"y":179.78723404255,"time":998},{"x":167.83757877238,"y":177.02127659574,"time":1005},{"x":167.83757877238,"y":175.63829787234,"time":1014},{"x":167.83757877238,"y":172.87234042553,"time":1020},{"x":167.83757877238,"y":170.10638297872,"time":1029},{"x":167.83757877238,"y":165.95744680851,"time":1044},{"x":167.83757877238,"y":163.1914893617,"time":1055},{"x":166.45460004897,"y":159.04255319149,"time":1069},{"x":166.45460004897,"y":156.27659574468,"time":1082},{"x":166.45460004897,"y":153.51063829787,"time":1090},{"x":166.45460004897,"y":152.12765957447,"time":1097},{"x":166.45460004897,"y":149.36170212766,"time":1103},{"x":166.45460004897,"y":147.97872340426,"time":1109},{"x":166.45460004897,"y":145.21276595745,"time":1120},{"x":166.45460004897,"y":141.06382978723,"time":1127},{"x":166.45460004897,"y":136.91489361702,"time":1134},{"x":166.45460004897,"y":135.53191489362,"time":1140},{"x":166.45460004897,"y":132.76595744681,"time":1149},{"x":167.83757877238,"y":130,"time":1157},{"x":167.83757877238,"y":127.23404255319,"time":1168},{"x":169.22055749578,"y":124.46808510638,"time":1174},{"x":169.22055749578,"y":123.08510638298,"time":1185},{"x":169.22055749578,"y":120.31914893617,"time":1196},{"x":169.22055749578,"y":118.93617021277,"time":1202},{"x":170.60353621918,"y":116.17021276596,"time":1208},{"x":170.60353621918,"y":113.40425531915,"time":1218},{"x":170.60353621918,"y":112.02127659574,"time":1225},{"x":170.60353621918,"y":109.25531914894,"time":1233},{"x":170.60353621918,"y":106.48936170213,"time":1242},{"x":170.60353621918,"y":105.10638297872,"time":1249},{"x":170.60353621918,"y":102.34042553191,"time":1256},{"x":170.60353621918,"y":100.95744680851,"time":1263},{"x":170.60353621918,"y":99.574468085106,"time":1270},{"x":170.60353621918,"y":96.808510638298,"time":1278},{"x":171.98651494259,"y":96.808510638298,"time":1282},{"x":171.98651494259,"y":95.425531914894,"time":1289},{"x":171.98651494259,"y":94.042553191489,"time":1297},{"x":171.98651494259,"y":92.659574468085,"time":1321},{"x":171.98651494259,"y":91.276595744681,"time":1329},{"x":171.98651494259,"y":89.893617021277,"time":1343},{"x":173.36949366599,"y":88.510638297872,"time":1346},{"x":173.36949366599,"y":87.127659574468,"time":1369},{"x":174.7524723894,"y":85.744680851064,"time":1380},{"x":174.7524723894,"y":84.36170212766,"time":1392},{"x":174.7524723894,"y":81.595744680851,"time":1396},{"x":174.7524723894,"y":80.212765957447,"time":1401},{"x":176.1354511128,"y":78.829787234043,"time":1410},{"x":176.1354511128,"y":77.446808510638,"time":1417},{"x":176.1354511128,"y":76.063829787234,"time":1427},{"x":176.1354511128,"y":74.68085106383,"time":1440},{"x":176.1354511128,"y":71.914893617021,"time":1449},{"x":176.1354511128,"y":69.148936170213,"time":1459},{"x":176.1354511128,"y":66.382978723404,"time":1470},{"x":176.1354511128,"y":65,"time":1478},{"x":176.1354511128,"y":63.617021276596,"time":1481},{"x":176.1354511128,"y":62.234042553191,"time":1500},{"x":167.83757877238,"y":44.255319148936,"time":1683},{"x":166.45460004897,"y":40.106382978723,"time":1688},{"x":166.45460004897,"y":37.340425531915,"time":1691},{"x":165.07162132557,"y":34.574468085106,"time":1701},{"x":163.68864260216,"y":31.808510638298,"time":1708},{"x":160.92268515535,"y":29.042553191489,"time":1714},{"x":159.53970643195,"y":26.276595744681,"time":1722},{"x":159.53970643195,"y":24.893617021277,"time":1729},{"x":158.15672770855,"y":23.510638297872,"time":1738},{"x":156.77374898514,"y":23.510638297872,"time":1759},{"x":156.77374898514,"y":22.127659574468,"time":1781}],[{"x":51.667366006418,"y":175.63829787234,"time":2512},{"x":57.199280900035,"y":175.63829787234,"time":2615},{"x":57.199280900035,"y":177.02127659574,"time":2617},{"x":58.582259623439,"y":177.02127659574,"time":2625},{"x":61.348217070248,"y":178.40425531915,"time":2633},{"x":64.114174517056,"y":178.40425531915,"time":2641},{"x":66.880131963865,"y":178.40425531915,"time":2658},{"x":68.263110687269,"y":179.78723404255,"time":2666},{"x":69.646089410673,"y":179.78723404255,"time":2673},{"x":71.029068134077,"y":179.78723404255,"time":2681},{"x":93.156727708545,"y":181.17021276596,"time":2803},{"x":94.53970643195,"y":181.17021276596,"time":2808},{"x":95.922685155354,"y":181.17021276596,"time":2816},{"x":97.305663878758,"y":181.17021276596,"time":2834},{"x":98.688642602162,"y":181.17021276596,"time":2849}],[{"x":68.263110687269,"y":141.06382978723,"time":3176},{"x":68.263110687269,"y":142.44680851064,"time":3183},{"x":68.263110687269,"y":143.82978723404,"time":3201},{"x":68.263110687269,"y":145.21276595745,"time":3209},{"x":68.263110687269,"y":146.59574468085,"time":3226},{"x":68.263110687269,"y":147.97872340426,"time":3238},{"x":68.263110687269,"y":150.74468085106,"time":3242},{"x":68.263110687269,"y":153.51063829787,"time":3251},{"x":68.263110687269,"y":157.65957446809,"time":3258},{"x":68.263110687269,"y":160.42553191489,"time":3268},{"x":68.263110687269,"y":170.10638297872,"time":3288},{"x":69.646089410673,"y":174.25531914894,"time":3292},{"x":69.646089410673,"y":177.02127659574,"time":3298},{"x":69.646089410673,"y":181.17021276596,"time":3310},{"x":69.646089410673,"y":183.93617021277,"time":3315},{"x":69.646089410673,"y":189.46808510638,"time":3324},{"x":69.646089410673,"y":193.6170212766,"time":3330},{"x":69.646089410673,"y":196.3829787234,"time":3340},{"x":69.646089410673,"y":199.14893617021,"time":3348},{"x":69.646089410673,"y":201.91489361702,"time":3361},{"x":69.646089410673,"y":206.06382978723,"time":3365},{"x":69.646089410673,"y":207.44680851064,"time":3371},{"x":69.646089410673,"y":208.82978723404,"time":3386},{"x":69.646089410673,"y":210.21276595745,"time":3395},{"x":69.646089410673,"y":211.59574468085,"time":3426}]]"""
a = json.loads(a)
b = json.loads(b)
visualize(a, b)
看起来像这样:
我真正不喜欢的是小部件/小块的定位。 通过手动调整x-widget的位置,我花了很长时间才达到这一点。而且我不喜欢这个结果。我的问题是:
答案 0 :(得分:1)
以下代码使用Tkinter:
#!/usr/bin/env python
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import json
import sys
if sys.version_info[0] < 3:
import Tkinter as Tk
else:
import tkinter as Tk
class Application(Tk.Frame):
def createWidgets(self):
self.master.wm_title("Analyze preprocessing")
fig = matplotlib.figure.Figure(dpi=100)
for i, data in enumerate([(a, "original"), (b, "preprocessed")]):
data, title = data
# new subplot for new data
ax = fig.add_subplot(1, 2, i+1)
ax.set_aspect(1)
# Set plot size
ax.axis((-20, 400, -20, 400))
# prepare data for a
for line in data:
xs, ys = [], []
for p in line:
xs.append(p['x'])
ys.append(p['y'])
# Invert y axis as data was recorded with HTML5 canvas
fig.gca().invert_yaxis()
ax.set_title(title)
# plot data
ax.plot(xs, ys, '-o')
# a tk.DrawingArea
canvas = FigureCanvasTkAgg(fig, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP)
canvas._tkcanvas.pack(side=Tk.TOP)
# Add widgets:
left_column = Tk.Frame(master=self.master,
width=200,
bg="",
colormap="new")
left_column.pack(side=Tk.LEFT)
right_column = Tk.Frame(master=self.master,
width=200,
bg="", padx=20,
colormap="new")
right_column.pack(side=Tk.RIGHT)
# Wild points
w = Tk.Label(left_column, text="Wild point count", padx=20)
w.pack(side=Tk.LEFT)
self.wild_point_counter = Tk.Text(left_column,
height=1,
width=4)
self.wild_point_counter.pack(side=Tk.LEFT)
self.wild_point_counter.insert(Tk.END, "12")
# Improvement
self.algorithm_improved_image = Tk.IntVar()
Tk.Checkbutton(master=right_column,
text="Algorithm improved image",
variable=self.algorithm_improved_image).grid(row=0,
sticky=Tk.W
)
self.other_problem = Tk.IntVar()
Tk.Checkbutton(master=right_column,
text="Other problem",
variable=self.other_problem).grid(row=1, sticky=Tk.W)
# submit button
button = Tk.Button(master=self.master,
text='Submit',
command=self.submit_form)
button.pack(side=Tk.BOTTOM)
Tk.mainloop()
def submit_form(self):
print("Algorithm improved image: %i" %
self.algorithm_improved_image.get())
print("Other problem: %i" %
self.other_problem.get())
print("Wild Points: %s" %
self.wild_point_counter.get(1.0, Tk.END))
def __init__(self, a, b, master=None):
self.a = a
self.b = b
Tk.Frame.__init__(self, master)
self.pack()
self.createWidgets()
if __name__ == '__main__':
a = """[[{"x":31.5854313228,"y":79.130434782609,"time":0},{"x":28.759344366278,"y":81.95652173913,"time":48},{"x":25.933257409757,"y":87.608695652174,"time":64},{"x":23.107170453235,"y":87.608695652174,"time":71},{"x":23.107170453235,"y":90.434782608696,"time":80},{"x":20.281083496713,"y":93.260869565217,"time":88},{"x":20.281083496713,"y":96.086956521739,"time":96},{"x":17.454996540191,"y":98.913043478261,"time":104},{"x":14.62890958367,"y":101.73913043478,"time":111},{"x":14.62890958367,"y":104.5652173913,"time":119},{"x":14.62890958367,"y":110.21739130435,"time":128},{"x":11.802822627148,"y":113.04347826087,"time":144},{"x":11.802822627148,"y":115.86956521739,"time":152},{"x":8.9767356706262,"y":121.52173913043,"time":160},{"x":8.9767356706262,"y":124.34782608696,"time":176},{"x":8.9767356706262,"y":127.17391304348,"time":184},{"x":8.9767356706262,"y":130,"time":200},{"x":6.1506487141045,"y":132.82608695652,"time":208},{"x":3.3245617575827,"y":138.47826086957,"time":216},{"x":3.3245617575827,"y":141.30434782609,"time":224},{"x":3.3245617575827,"y":144.13043478261,"time":232},{"x":3.3245617575827,"y":146.95652173913,"time":239},{"x":0.49847480106101,"y":149.78260869565,"time":248},{"x":0.49847480106101,"y":152.60869565217,"time":256},{"x":0.49847480106101,"y":158.26086956522,"time":273},{"x":0.49847480106101,"y":161.08695652174,"time":280},{"x":0.49847480106101,"y":166.73913043478,"time":288},{"x":0.49847480106101,"y":169.5652173913,"time":296},{"x":0.49847480106101,"y":175.21739130435,"time":312},{"x":0.49847480106101,"y":178.04347826087,"time":319},{"x":0.49847480106101,"y":180.86956521739,"time":327},{"x":0.49847480106101,"y":183.69565217391,"time":336},{"x":0.49847480106101,"y":186.52173913043,"time":344},{"x":0.49847480106101,"y":189.34782608696,"time":360},{"x":0.49847480106101,"y":195,"time":368},{"x":0.49847480106101,"y":200.65217391304,"time":374},{"x":0.49847480106101,"y":203.47826086957,"time":381},{"x":0.49847480106101,"y":206.30434782609,"time":387},{"x":0.49847480106101,"y":211.95652173913,"time":395},{"x":0.49847480106101,"y":217.60869565217,"time":401},{"x":0.49847480106101,"y":220.4347826087,"time":408},{"x":0.49847480106101,"y":226.08695652174,"time":416},{"x":0.49847480106101,"y":231.73913043478,"time":424},{"x":0.49847480106101,"y":237.39130434783,"time":432},{"x":3.3245617575827,"y":243.04347826087,"time":440},{"x":6.1506487141045,"y":248.69565217391,"time":447},{"x":6.1506487141045,"y":254.34782608696,"time":456},{"x":8.9767356706262,"y":262.82608695652,"time":464},{"x":14.62890958367,"y":268.47826086957,"time":472},{"x":14.62890958367,"y":274.13043478261,"time":482},{"x":20.281083496713,"y":282.60869565217,"time":487},{"x":25.933257409757,"y":293.91304347826,"time":496},{"x":25.933257409757,"y":299.5652173913,"time":505},{"x":28.759344366278,"y":305.21739130435,"time":512},{"x":34.411518279322,"y":313.69565217391,"time":520},{"x":37.237605235844,"y":319.34782608696,"time":529},{"x":42.889779148887,"y":330.65217391304,"time":536},{"x":45.715866105409,"y":336.30434782609,"time":544},{"x":57.020213931496,"y":347.60869565217,"time":553},{"x":59.846300888018,"y":353.26086956522,"time":561},{"x":65.498474801061,"y":358.91304347826,"time":568},{"x":71.150648714104,"y":361.73913043478,"time":577},{"x":76.802822627148,"y":370.21739130435,"time":584},{"x":82.454996540191,"y":373.04347826087,"time":594},{"x":85.281083496713,"y":378.69565217391,"time":602},{"x":88.107170453235,"y":378.69565217391,"time":611},{"x":96.5854313228,"y":384.34782608696,"time":617},{"x":99.411518279322,"y":387.17391304348,"time":632},{"x":107.88977914889,"y":390,"time":640},{"x":110.71586610541,"y":390,"time":655},{"x":113.54195306193,"y":390,"time":664},{"x":119.19412697497,"y":390,"time":672},{"x":122.0202139315,"y":390,"time":680},{"x":124.84630088802,"y":390,"time":688},{"x":133.32456175758,"y":390,"time":697},{"x":136.1506487141,"y":390,"time":704},{"x":141.80282262715,"y":390,"time":712},{"x":147.45499654019,"y":390,"time":720},{"x":150.28108349671,"y":390,"time":729},{"x":158.75934436628,"y":384.34782608696,"time":736},{"x":175.71586610541,"y":375.86956521739,"time":763},{"x":184.19412697497,"y":370.21739130435,"time":771},{"x":189.84630088802,"y":364.5652173913,"time":789},{"x":192.67238784454,"y":361.73913043478,"time":800},{"x":195.49847480106,"y":361.73913043478,"time":811},{"x":198.32456175758,"y":356.08695652174,"time":821},{"x":201.1506487141,"y":353.26086956522,"time":832},{"x":203.97673567063,"y":350.4347826087,"time":841},{"x":206.80282262715,"y":347.60869565217,"time":849},{"x":209.62890958367,"y":344.78260869565,"time":863},{"x":212.45499654019,"y":339.13043478261,"time":874},{"x":212.45499654019,"y":336.30434782609,"time":882},{"x":215.28108349671,"y":330.65217391304,"time":892},{"x":215.28108349671,"y":327.82608695652,"time":902},{"x":215.28108349671,"y":325,"time":911},{"x":215.28108349671,"y":316.52173913043,"time":923},{"x":215.28108349671,"y":310.86956521739,"time":933},{"x":218.10717045323,"y":308.04347826087,"time":943},{"x":218.10717045323,"y":302.39130434783,"time":953},{"x":220.93325740976,"y":296.73913043478,"time":961},{"x":220.93325740976,"y":291.08695652174,"time":972},{"x":220.93325740976,"y":285.4347826087,"time":981},{"x":220.93325740976,"y":282.60869565217,"time":990},{"x":220.93325740976,"y":276.95652173913,"time":1001},{"x":223.75934436628,"y":265.65217391304,"time":1012},{"x":223.75934436628,"y":260,"time":1021},{"x":223.75934436628,"y":254.34782608696,"time":1030},{"x":223.75934436628,"y":245.86956521739,"time":1039},{"x":223.75934436628,"y":243.04347826087,"time":1049},{"x":223.75934436628,"y":240.21739130435,"time":1058},{"x":223.75934436628,"y":228.91304347826,"time":1069},{"x":223.75934436628,"y":223.26086956522,"time":1078},{"x":223.75934436628,"y":217.60869565217,"time":1088},{"x":223.75934436628,"y":211.95652173913,"time":1097},{"x":223.75934436628,"y":197.82608695652,"time":1107},{"x":223.75934436628,"y":189.34782608696,"time":1117},{"x":223.75934436628,"y":180.86956521739,"time":1126},{"x":220.93325740976,"y":172.39130434783,"time":1137},{"x":218.10717045323,"y":169.5652173913,"time":1145},{"x":212.45499654019,"y":158.26086956522,"time":1155},{"x":212.45499654019,"y":152.60869565217,"time":1165},{"x":206.80282262715,"y":146.95652173913,"time":1175},{"x":201.1506487141,"y":141.30434782609,"time":1195},{"x":198.32456175758,"y":135.65217391304,"time":1205},{"x":195.49847480106,"y":135.65217391304,"time":1218},{"x":192.67238784454,"y":130,"time":1228},{"x":189.84630088802,"y":127.17391304348,"time":1237},{"x":184.19412697497,"y":121.52173913043,"time":1250},{"x":181.36804001845,"y":118.69565217391,"time":1260},{"x":178.54195306193,"y":115.86956521739,"time":1271},{"x":178.54195306193,"y":113.04347826087,"time":1283},{"x":172.88977914889,"y":107.39130434783,"time":1294},{"x":172.88977914889,"y":104.5652173913,"time":1311},{"x":164.41151827932,"y":98.913043478261,"time":1321},{"x":155.93325740976,"y":96.086956521739,"time":1332},{"x":150.28108349671,"y":90.434782608696,"time":1343},{"x":147.45499654019,"y":90.434782608696,"time":1355},{"x":144.62890958367,"y":87.608695652174,"time":1365},{"x":141.80282262715,"y":84.782608695652,"time":1377},{"x":136.1506487141,"y":81.95652173913,"time":1387},{"x":133.32456175758,"y":79.130434782609,"time":1397},{"x":130.49847480106,"y":79.130434782609,"time":1406},{"x":127.67238784454,"y":76.304347826087,"time":1420},{"x":122.0202139315,"y":73.478260869565,"time":1434},{"x":119.19412697497,"y":70.652173913043,"time":1456},{"x":116.36804001845,"y":70.652173913043,"time":1473},{"x":116.36804001845,"y":67.826086956522,"time":1483},{"x":110.71586610541,"y":67.826086956522,"time":1494},{"x":110.71586610541,"y":65,"time":1506},{"x":107.88977914889,"y":65,"time":1516},{"x":105.06369219237,"y":62.173913043478,"time":1538},{"x":102.23760523584,"y":62.173913043478,"time":1560},{"x":99.411518279322,"y":62.173913043478,"time":1569},{"x":99.411518279322,"y":59.347826086957,"time":1579},{"x":96.5854313228,"y":59.347826086957,"time":1589},{"x":90.933257409757,"y":56.521739130435,"time":1601},{"x":88.107170453235,"y":56.521739130435,"time":1617},{"x":85.281083496713,"y":56.521739130435,"time":1632},{"x":82.454996540191,"y":53.695652173913,"time":1642},{"x":79.62890958367,"y":53.695652173913,"time":1656},{"x":76.802822627148,"y":53.695652173913,"time":1666},{"x":73.976735670626,"y":53.695652173913,"time":1678},{"x":71.150648714104,"y":53.695652173913,"time":1689},{"x":68.324561757583,"y":53.695652173913,"time":1704},{"x":65.498474801061,"y":53.695652173913,"time":1720},{"x":62.672387844539,"y":53.695652173913,"time":1730},{"x":59.846300888018,"y":53.695652173913,"time":1744},{"x":57.020213931496,"y":53.695652173913,"time":1768},{"x":54.194126974974,"y":53.695652173913,"time":1801},{"x":51.368040018452,"y":53.695652173913,"time":1817},{"x":48.541953061931,"y":53.695652173913,"time":1840},{"x":48.541953061931,"y":56.521739130435,"time":1857},{"x":45.715866105409,"y":56.521739130435,"time":1865},{"x":42.889779148887,"y":56.521739130435,"time":1889},{"x":42.889779148887,"y":59.347826086957,"time":1904},{"x":40.063692192365,"y":59.347826086957,"time":1913},{"x":37.237605235844,"y":59.347826086957,"time":1925},{"x":37.237605235844,"y":62.173913043478,"time":1944},{"x":34.411518279322,"y":62.173913043478,"time":1954},{"x":34.411518279322,"y":65,"time":1968},{"x":31.5854313228,"y":65,"time":1992},{"x":31.5854313228,"y":67.826086956522,"time":2016},{"x":28.759344366278,"y":67.826086956522,"time":2032},{"x":28.759344366278,"y":70.652173913043,"time":2065},{"x":28.759344366278,"y":73.478260869565,"time":2075},{"x":28.759344366278,"y":76.304347826087,"time":2096},{"x":28.759344366278,"y":79.130434782609,"time":2137},{"x":31.5854313228,"y":79.130434782609,"time":2152},{"x":34.411518279322,"y":79.130434782609,"time":2216},{"x":37.237605235844,"y":79.130434782609,"time":2241},{"x":42.889779148887,"y":76.304347826087,"time":2256},{"x":42.889779148887,"y":73.478260869565,"time":2272},{"x":45.715866105409,"y":73.478260869565,"time":2286},{"x":45.715866105409,"y":70.652173913043,"time":2297},{"x":54.194126974974,"y":62.173913043478,"time":2308},{"x":59.846300888018,"y":62.173913043478,"time":2319},{"x":62.672387844539,"y":56.521739130435,"time":2335},{"x":71.150648714104,"y":50.869565217391,"time":2347},{"x":73.976735670626,"y":50.869565217391,"time":2359},{"x":85.281083496713,"y":45.217391304348,"time":2370},{"x":90.933257409757,"y":45.217391304348,"time":2382},{"x":93.759344366278,"y":42.391304347826,"time":2395},{"x":110.71586610541,"y":36.739130434783,"time":2408},{"x":138.97673567063,"y":33.913043478261,"time":2438},{"x":153.10717045323,"y":31.086956521739,"time":2453},{"x":158.75934436628,"y":31.086956521739,"time":2465},{"x":170.06369219237,"y":31.086956521739,"time":2478},{"x":178.54195306193,"y":28.260869565217,"time":2489},{"x":192.67238784454,"y":25.434782608696,"time":2501},{"x":198.32456175758,"y":25.434782608696,"time":2514},{"x":209.62890958367,"y":22.608695652174,"time":2527},{"x":223.75934436628,"y":22.608695652174,"time":2538},{"x":232.23760523584,"y":19.782608695652,"time":2549},{"x":240.71586610541,"y":19.782608695652,"time":2562},{"x":249.19412697497,"y":16.95652173913,"time":2572},{"x":263.32456175758,"y":14.130434782609,"time":2584},{"x":274.62890958367,"y":11.304347826087,"time":2595},{"x":280.28108349671,"y":11.304347826087,"time":2608},{"x":294.41151827932,"y":8.4782608695652,"time":2619},{"x":300.06369219237,"y":8.4782608695652,"time":2632},{"x":308.54195306193,"y":5.6521739130435,"time":2644},{"x":319.84630088802,"y":2.8260869565217,"time":2659},{"x":322.67238784454,"y":2.8260869565217,"time":2673},{"x":328.32456175758,"y":0,"time":2685}]]"""
b = """[[{"x":0.49715324046033,"y":0,"time":0},{"x":0.49715324046033,"y":1.3829787234043,"time":42},{"x":0.49715324046033,"y":15.212765957447,"time":87},{"x":0.49715324046033,"y":26.276595744681,"time":102},{"x":0.49715324046033,"y":34.574468085106,"time":107},{"x":0.49715324046033,"y":65,"time":124},{"x":0.49715324046033,"y":98.191489361702,"time":140},{"x":0.49715324046033,"y":135.53191489362,"time":157},{"x":0.49715324046033,"y":153.51063829787,"time":161},{"x":0.49715324046033,"y":172.87234042553,"time":174},{"x":0.49715324046033,"y":193.6170212766,"time":179},{"x":3.2631106872688,"y":232.34042553191,"time":195},{"x":6.0290681340773,"y":265.53191489362,"time":210},{"x":6.0290681340773,"y":298.72340425532,"time":228},{"x":8.7950255808859,"y":333.29787234043,"time":244},{"x":11.560983027694,"y":348.51063829787,"time":250},{"x":15.709919197907,"y":360.95744680851,"time":264},{"x":18.475876644716,"y":369.25531914894,"time":265},{"x":18.475876644716,"y":376.17021276596,"time":281},{"x":19.85885536812,"y":380.31914893617,"time":285},{"x":21.241834091524,"y":384.46808510638,"time":301},{"x":24.007791538333,"y":387.23404255319,"time":322},{"x":29.53970643195,"y":388.6170212766,"time":337},{"x":33.688642602162,"y":390,"time":352},{"x":36.454600048971,"y":390,"time":356},{"x":43.369493665992,"y":390,"time":370},{"x":50.284387283014,"y":388.6170212766,"time":386},{"x":58.582259623439,"y":385.85106382979,"time":402},{"x":64.114174517056,"y":383.08510638298,"time":418},{"x":66.880131963865,"y":380.31914893617,"time":435},{"x":72.412046857482,"y":377.55319148936,"time":454},{"x":76.560983027694,"y":374.78723404255,"time":459},{"x":82.092897921311,"y":372.02127659574,"time":474},{"x":84.85885536812,"y":370.63829787234,"time":488},{"x":87.624812814928,"y":367.87234042553,"time":490},{"x":91.773748985141,"y":365.10638297872,"time":504},{"x":94.53970643195,"y":363.72340425532,"time":506},{"x":97.305663878758,"y":360.95744680851,"time":523},{"x":102.83757877238,"y":356.8085106383,"time":541},{"x":109.7524723894,"y":352.65957446809,"time":556},{"x":113.90140855961,"y":349.89361702128,"time":563},{"x":119.43332345323,"y":342.97872340426,"time":579},{"x":124.96523834684,"y":337.44680851064,"time":597},{"x":127.73119579365,"y":333.29787234043,"time":602},{"x":130.49715324046,"y":327.76595744681,"time":623},{"x":134.64608941067,"y":325,"time":626},{"x":137.41204685748,"y":320.85106382979,"time":634},{"x":144.3269404745,"y":313.93617021277,"time":659},{"x":147.09289792131,"y":309.78723404255,"time":674},{"x":147.09289792131,"y":308.40425531915,"time":681},{"x":160.92268515535,"y":269.68085106383,"time":787},{"x":162.30566387876,"y":262.76595744681,"time":803},{"x":162.30566387876,"y":257.23404255319,"time":823},{"x":163.68864260216,"y":254.46808510638,"time":829},{"x":163.68864260216,"y":250.31914893617,"time":833},{"x":163.68864260216,"y":246.17021276596,"time":841},{"x":163.68864260216,"y":240.63829787234,"time":849},{"x":165.07162132557,"y":236.48936170213,"time":863},{"x":165.07162132557,"y":230.95744680851,"time":868},{"x":166.45460004897,"y":224.04255319149,"time":876},{"x":167.83757877238,"y":221.27659574468,"time":882},{"x":167.83757877238,"y":217.12765957447,"time":892},{"x":167.83757877238,"y":212.97872340426,"time":897},{"x":167.83757877238,"y":210.21276595745,"time":905},{"x":167.83757877238,"y":206.06382978723,"time":913},{"x":167.83757877238,"y":199.14893617021,"time":934},{"x":167.83757877238,"y":196.3829787234,"time":937},{"x":167.83757877238,"y":193.6170212766,"time":947},{"x":167.83757877238,"y":190.85106382979,"time":953},{"x":166.45460004897,"y":188.08510638298,"time":961},{"x":166.45460004897,"y":185.31914893617,"time":970},{"x":166.45460004897,"y":182.55319148936,"time":981},{"x":167.83757877238,"y":181.17021276596,"time":991},{"x":167.83757877238,"y":179.78723404255,"time":998},{"x":167.83757877238,"y":177.02127659574,"time":1005},{"x":167.83757877238,"y":175.63829787234,"time":1014},{"x":167.83757877238,"y":172.87234042553,"time":1020},{"x":167.83757877238,"y":170.10638297872,"time":1029},{"x":167.83757877238,"y":165.95744680851,"time":1044},{"x":167.83757877238,"y":163.1914893617,"time":1055},{"x":166.45460004897,"y":159.04255319149,"time":1069},{"x":166.45460004897,"y":156.27659574468,"time":1082},{"x":166.45460004897,"y":153.51063829787,"time":1090},{"x":166.45460004897,"y":152.12765957447,"time":1097},{"x":166.45460004897,"y":149.36170212766,"time":1103},{"x":166.45460004897,"y":147.97872340426,"time":1109},{"x":166.45460004897,"y":145.21276595745,"time":1120},{"x":166.45460004897,"y":141.06382978723,"time":1127},{"x":166.45460004897,"y":136.91489361702,"time":1134},{"x":166.45460004897,"y":135.53191489362,"time":1140},{"x":166.45460004897,"y":132.76595744681,"time":1149},{"x":167.83757877238,"y":130,"time":1157},{"x":167.83757877238,"y":127.23404255319,"time":1168},{"x":169.22055749578,"y":124.46808510638,"time":1174},{"x":169.22055749578,"y":123.08510638298,"time":1185},{"x":169.22055749578,"y":120.31914893617,"time":1196},{"x":169.22055749578,"y":118.93617021277,"time":1202},{"x":170.60353621918,"y":116.17021276596,"time":1208},{"x":170.60353621918,"y":113.40425531915,"time":1218},{"x":170.60353621918,"y":112.02127659574,"time":1225},{"x":170.60353621918,"y":109.25531914894,"time":1233},{"x":170.60353621918,"y":106.48936170213,"time":1242},{"x":170.60353621918,"y":105.10638297872,"time":1249},{"x":170.60353621918,"y":102.34042553191,"time":1256},{"x":170.60353621918,"y":100.95744680851,"time":1263},{"x":170.60353621918,"y":99.574468085106,"time":1270},{"x":170.60353621918,"y":96.808510638298,"time":1278},{"x":171.98651494259,"y":96.808510638298,"time":1282},{"x":171.98651494259,"y":95.425531914894,"time":1289},{"x":171.98651494259,"y":94.042553191489,"time":1297},{"x":171.98651494259,"y":92.659574468085,"time":1321},{"x":171.98651494259,"y":91.276595744681,"time":1329},{"x":171.98651494259,"y":89.893617021277,"time":1343},{"x":173.36949366599,"y":88.510638297872,"time":1346},{"x":173.36949366599,"y":87.127659574468,"time":1369},{"x":174.7524723894,"y":85.744680851064,"time":1380},{"x":174.7524723894,"y":84.36170212766,"time":1392},{"x":174.7524723894,"y":81.595744680851,"time":1396},{"x":174.7524723894,"y":80.212765957447,"time":1401},{"x":176.1354511128,"y":78.829787234043,"time":1410},{"x":176.1354511128,"y":77.446808510638,"time":1417},{"x":176.1354511128,"y":76.063829787234,"time":1427},{"x":176.1354511128,"y":74.68085106383,"time":1440},{"x":176.1354511128,"y":71.914893617021,"time":1449},{"x":176.1354511128,"y":69.148936170213,"time":1459},{"x":176.1354511128,"y":66.382978723404,"time":1470},{"x":176.1354511128,"y":65,"time":1478},{"x":176.1354511128,"y":63.617021276596,"time":1481},{"x":176.1354511128,"y":62.234042553191,"time":1500},{"x":167.83757877238,"y":44.255319148936,"time":1683},{"x":166.45460004897,"y":40.106382978723,"time":1688},{"x":166.45460004897,"y":37.340425531915,"time":1691},{"x":165.07162132557,"y":34.574468085106,"time":1701},{"x":163.68864260216,"y":31.808510638298,"time":1708},{"x":160.92268515535,"y":29.042553191489,"time":1714},{"x":159.53970643195,"y":26.276595744681,"time":1722},{"x":159.53970643195,"y":24.893617021277,"time":1729},{"x":158.15672770855,"y":23.510638297872,"time":1738},{"x":156.77374898514,"y":23.510638297872,"time":1759},{"x":156.77374898514,"y":22.127659574468,"time":1781}],[{"x":51.667366006418,"y":175.63829787234,"time":2512},{"x":57.199280900035,"y":175.63829787234,"time":2615},{"x":57.199280900035,"y":177.02127659574,"time":2617},{"x":58.582259623439,"y":177.02127659574,"time":2625},{"x":61.348217070248,"y":178.40425531915,"time":2633},{"x":64.114174517056,"y":178.40425531915,"time":2641},{"x":66.880131963865,"y":178.40425531915,"time":2658},{"x":68.263110687269,"y":179.78723404255,"time":2666},{"x":69.646089410673,"y":179.78723404255,"time":2673},{"x":71.029068134077,"y":179.78723404255,"time":2681},{"x":93.156727708545,"y":181.17021276596,"time":2803},{"x":94.53970643195,"y":181.17021276596,"time":2808},{"x":95.922685155354,"y":181.17021276596,"time":2816},{"x":97.305663878758,"y":181.17021276596,"time":2834},{"x":98.688642602162,"y":181.17021276596,"time":2849}],[{"x":68.263110687269,"y":141.06382978723,"time":3176},{"x":68.263110687269,"y":142.44680851064,"time":3183},{"x":68.263110687269,"y":143.82978723404,"time":3201},{"x":68.263110687269,"y":145.21276595745,"time":3209},{"x":68.263110687269,"y":146.59574468085,"time":3226},{"x":68.263110687269,"y":147.97872340426,"time":3238},{"x":68.263110687269,"y":150.74468085106,"time":3242},{"x":68.263110687269,"y":153.51063829787,"time":3251},{"x":68.263110687269,"y":157.65957446809,"time":3258},{"x":68.263110687269,"y":160.42553191489,"time":3268},{"x":68.263110687269,"y":170.10638297872,"time":3288},{"x":69.646089410673,"y":174.25531914894,"time":3292},{"x":69.646089410673,"y":177.02127659574,"time":3298},{"x":69.646089410673,"y":181.17021276596,"time":3310},{"x":69.646089410673,"y":183.93617021277,"time":3315},{"x":69.646089410673,"y":189.46808510638,"time":3324},{"x":69.646089410673,"y":193.6170212766,"time":3330},{"x":69.646089410673,"y":196.3829787234,"time":3340},{"x":69.646089410673,"y":199.14893617021,"time":3348},{"x":69.646089410673,"y":201.91489361702,"time":3361},{"x":69.646089410673,"y":206.06382978723,"time":3365},{"x":69.646089410673,"y":207.44680851064,"time":3371},{"x":69.646089410673,"y":208.82978723404,"time":3386},{"x":69.646089410673,"y":210.21276595745,"time":3395},{"x":69.646089410673,"y":211.59574468085,"time":3426}]]"""
a = json.loads(a)
b = json.loads(b)
root = Tk.Tk()
app = Application(a, b, master=root)
app.mainloop()
root.destroy()