In [1]:
import os
import sys
import random
import time
from random import seed, randint
import argparse
import platform
from datetime import datetime
import imp
import numpy as np
import fileinput
from itertools import product
import pandas as pd
from scipy.interpolate import griddata
from scipy.interpolate import interp2d
import seaborn as sns
from os import listdir

import matplotlib.pyplot as plt
import seaborn as sns
from scipy.interpolate import griddata
import matplotlib as mpl
sys.path.insert(0,'..')
from notebookFunctions import *
# from .. import notebookFunctions

%matplotlib inline
plt.rcParams['figure.figsize'] = (10,6.180)    #golden ratio
# %matplotlib notebook
%load_ext autoreload
%autoreload 2

In [2]:
data = pd.read_feather("/Users/weilu/Research/server/apr_2018/fifth_2/force_0.02_rg_0.1_lipid_1.0_mem_1_go_0.8_biask_0.5/rerun_1_29_Apr_193902.feather")
dic = {"T0":280, "T1":290, "T2":300, "T3":310, "T4":320, "T5":335, "T6":350, "T7":365, "T8":380, "T9":410, "T10":440, "T11":470}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
rerun1 = data
t = a.query("Temp < 400").groupby(["BiasTo","Temp"])[["DisReal","Run"]].mean().reset_index()
t["Diff"] = t["DisReal"]-t["BiasTo"].apply(pd.to_numeric)
t["BiasTo"] = t["BiasTo"].apply(pd.to_numeric)
fg = sns.FacetGrid(data=t, hue='Temp', size=8, aspect=1.61)
fg.map(plt.scatter, 'BiasTo', 'Diff').add_legend()


Out[2]:
<seaborn.axisgrid.FacetGrid at 0x1a43ea3470>

In [3]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x111e82588>

In [10]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "Lipid1", cmap="seismic", sharex=False)


Out[10]:
<matplotlib.axes._subplots.AxesSubplot at 0x115d4cda0>

In [5]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)


Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a25d833c8>

In [8]:
rerun1.query("Temp == 300 and z_h6 > -10").groupby(["BiasTo", "Run"])["DisReal"].describe().query("count > 300")


Out[8]:
count mean std min 25% 50% 75% max
BiasTo Run
100.0 0 305.0 99.699533 1.182848 96.228146 98.911035 99.731889 100.554146 103.438021
11 354.0 99.807613 1.365881 96.096134 98.784685 99.908731 100.803164 103.558215
30.0 3 344.0 30.314299 1.122194 26.995739 29.535524 30.348229 31.103515 33.668511
5 328.0 30.350844 1.228046 25.951048 29.494394 30.367534 31.236828 33.166975
32.0 11 324.0 32.074892 1.333118 27.943034 31.278613 32.117816 32.837022 35.766403
34.0 2 310.0 33.819303 1.245137 30.003292 32.955652 33.864579 34.685682 37.615490
9 338.0 33.886355 1.112079 30.777261 33.236969 33.946652 34.634834 37.861493
10 320.0 33.683231 1.252458 30.559919 32.776952 33.681134 34.551386 38.688319
36.0 5 341.0 35.586270 1.193849 32.102241 34.879920 35.625643 36.408361 39.040840
38.0 1 325.0 37.439630 1.310174 33.782283 36.604654 37.452581 38.159400 41.408583
8 328.0 37.370213 1.229413 33.639161 36.538885 37.463934 38.232033 40.028040
40.0 4 308.0 39.228865 1.296813 35.670219 38.379476 39.258007 40.032696 42.695405
42.0 1 305.0 40.968523 1.321294 37.504592 40.044241 40.902196 41.848675 44.590621
4 308.0 41.168467 1.296257 38.008755 40.371224 41.163919 42.060182 44.616393
5 319.0 41.050688 1.280713 36.678465 40.150063 41.011664 41.982087 44.696741
44.0 2 322.0 42.882100 1.278265 39.510999 42.010153 42.854153 43.824468 46.427000
10 321.0 42.899690 1.252265 39.312675 41.997098 42.957289 43.837223 46.059403
46.0 7 330.0 44.882988 1.205783 41.237666 43.951879 44.893334 45.714798 48.112752
9 334.0 44.709980 1.187743 41.927286 43.891786 44.715993 45.562684 47.597832
48.0 0 318.0 46.602584 1.168037 43.226501 45.855700 46.493988 47.355886 50.037508
50.0 8 330.0 48.415600 1.228923 45.238644 47.540966 48.457584 49.331979 51.615352
9 336.0 48.431641 1.236634 43.972174 47.536844 48.375549 49.272203 52.089999
52.0 8 309.0 50.125787 1.247946 46.091539 49.348452 50.091391 50.985636 54.032837
9 326.0 50.136975 1.186557 46.664311 49.344085 50.243842 50.984136 53.402051
54.0 11 320.0 51.916353 1.135781 49.123745 51.196730 51.909534 52.683686 54.941665
58.0 3 310.0 55.236197 1.183121 51.559789 54.358901 55.233605 56.098118 58.259148
60.0 2 320.0 56.813636 1.156497 52.996726 56.012602 56.833541 57.594806 59.834017
62.0 0 324.0 58.579035 1.167392 55.445585 57.794225 58.640642 59.312670 62.587402
6 306.0 58.691638 1.110857 55.997172 57.932569 58.648410 59.308939 62.443616
11 362.0 58.653661 1.154263 55.618569 57.858837 58.601794 59.375708 61.870953
... ... ... ... ... ... ... ... ... ...
66.0 0 348.0 62.134121 1.223225 58.914065 61.282520 62.095157 63.009794 66.025642
4 376.0 62.188015 1.216972 58.738772 61.399154 62.289046 63.004791 65.061932
5 329.0 62.180310 1.226351 58.942983 61.345562 62.125994 63.030221 65.462036
6 418.0 62.257096 1.207501 59.335145 61.372829 62.241455 63.123736 65.623235
7 365.0 62.228989 1.168005 58.767244 61.422594 62.170317 62.983613 65.633819
9 362.0 62.077292 1.169955 57.999556 61.280245 62.112824 62.805599 65.566819
68.0 2 537.0 64.024498 1.117231 60.397825 63.322450 64.058122 64.758408 67.127374
5 430.0 64.047113 1.184518 60.962990 63.235281 63.985597 64.893201 67.436084
6 487.0 64.201000 1.210677 60.642213 63.445280 64.172860 65.000207 69.703726
7 430.0 64.007563 1.143437 60.358810 63.266695 63.961741 64.717137 67.630446
8 468.0 64.066493 1.209036 60.463184 63.293487 64.098847 64.796946 67.757990
70.0 0 502.0 65.862128 1.205762 62.519189 65.024794 65.813839 66.707307 68.930186
1 412.0 65.971354 1.295903 62.582139 65.101717 65.906038 66.779505 71.333374
6 474.0 65.860209 1.126359 62.594046 65.142406 65.820472 66.642970 69.315344
8 574.0 65.773049 1.215792 61.853233 64.959723 65.739841 66.665814 69.026418
76.0 3 370.0 76.144740 1.346413 71.523499 75.218474 76.119967 77.037519 79.279194
4 307.0 76.115006 1.396200 71.859664 75.226982 76.160708 77.038069 80.886485
7 313.0 76.052802 1.344142 71.635394 75.093187 76.034324 77.053832 80.315708
78.0 11 344.0 78.015980 1.302000 74.862068 77.188412 78.037859 78.719532 81.762363
82.0 0 304.0 81.912567 1.325725 78.658724 81.007391 81.969092 82.903433 85.071033
11 312.0 82.049713 1.330686 78.772274 81.128748 81.950870 82.858795 85.690569
86.0 1 314.0 85.881297 1.403043 82.224718 84.970866 85.961836 86.804493 89.284594
88.0 2 322.0 87.903933 1.296449 84.410436 87.037699 87.884910 88.773831 91.733597
9 305.0 87.887082 1.357029 84.191390 87.001635 87.792713 88.854282 91.472993
90.0 1 320.0 89.920611 1.293333 86.058598 89.058346 89.942500 90.732738 93.906341
92.0 2 349.0 91.780401 1.317090 88.228635 90.842548 91.720683 92.693545 95.732558
8 334.0 91.831393 1.445431 88.037405 90.928760 91.830346 92.915783 95.493975
96.0 10 328.0 95.823178 1.336660 91.276739 94.837359 95.895328 96.665800 100.139162
98.0 0 334.0 97.672886 1.342912 93.739508 96.738374 97.686461 98.603628 101.095477
7 319.0 97.732939 1.302759 93.817491 96.819192 97.713712 98.601417 102.155927

65 rows × 8 columns


In [11]:
data = pd.read_feather("/Users/weilu/Research/server/apr_2018/fifth_2/force_0.02_rg_0.1_lipid_1.0_mem_1_go_0.8_biask_0.5_enhance/rerun_1_30_Apr_150140.feather")
dic = {"T0":280, "T1":290, "T2":300, "T3":310, "T4":320, "T5":335, "T6":350, "T7":365, "T8":380, "T9":410, "T10":440, "T11":470}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
rerun1 = data
t = a.query("Temp < 400").groupby(["BiasTo","Temp"])[["DisReal","Run"]].mean().reset_index()
t["Diff"] = t["DisReal"]-t["BiasTo"].apply(pd.to_numeric)
t["BiasTo"] = t["BiasTo"].apply(pd.to_numeric)
fg = sns.FacetGrid(data=t, hue='Temp', size=8, aspect=1.61)
fg.map(plt.scatter, 'BiasTo', 'Diff').add_legend()


Out[11]:
<seaborn.axisgrid.FacetGrid at 0x1157cab70>

In [53]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[53]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a194e99e8>

In [54]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "AMH-Go", cmap="seismic", sharex=False)


Out[54]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a1ab03eb8>

In [55]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "TotalE", cmap="seismic", sharex=False)


Out[55]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a23358e80>

In [62]:
rerun1.query("Temp == 300 and DisReal > 60")["Lipid4"].min()


Out[62]:
-3.30789367707193

In [75]:
rerun1.query("Temp == 300 and Lipid4 < 0")["Lipid13"].hist(bins=50)


Out[75]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a1af82b00>

In [64]:
rerun1.query("Temp == 300 and Lipid4 < 0")["Lipid4"].hist(bins=50)


Out[64]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a1b61f9b0>

In [60]:
rerun1.query("Temp == 300 and DisReal > 60").hist("TotalE",bins=50)


Out[60]:
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x1a1b58d898>]], dtype=object)

In [13]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)


Out[13]:
<matplotlib.axes._subplots.AxesSubplot at 0x115f0ccc0>

In [40]:
rerun1.query("Temp == 350").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[40]:
<matplotlib.axes._subplots.AxesSubplot at 0x11646d6d8>

In [37]:
rerun1.query("Temp == 380 and Qw < 0.3 and z_h6 > -10").plot.hexbin("Qw", "z_h6", cmap="seismic", sharex=False)


Out[37]:
<matplotlib.axes._subplots.AxesSubplot at 0x1179bbc18>

In [38]:
t = rerun1.query("Temp == 380 and Qw < 0.3 and z_h6 > -10")
t.groupby(["BiasTo", "Run"])["DisReal"].describe().query("count > 100")


Out[38]:
count mean std min 25% 50% 75% max
BiasTo Run
60.0 6 116.0 60.643955 1.446694 56.747410 59.534067 60.848185 61.548234 64.511868
8 154.0 60.388496 1.360507 56.988080 59.571451 60.334722 61.197585 63.934662
62.0 8 278.0 62.302338 1.467088 58.589756 61.264496 62.386321 63.276305 66.565176
10 326.0 62.189518 1.340104 56.876473 61.304165 62.171938 63.082094 65.761575
64.0 1 223.0 64.228448 1.369998 61.128511 63.334094 64.212539 65.069352 67.969850
4 441.0 64.104976 1.417446 59.434060 63.146290 64.000082 65.001156 67.977873
6 282.0 64.433464 1.491446 60.003349 63.367507 64.425783 65.466862 68.512491
10 547.0 64.402938 1.425785 60.331011 63.490832 64.390192 65.408895 68.251498
66.0 1 134.0 66.293052 1.379458 62.514822 65.235326 66.303985 67.391703 69.416886
3 272.0 65.605718 1.337174 61.739275 64.833966 65.587955 66.448501 69.540769
4 488.0 66.328089 1.413657 61.974736 65.438485 66.388820 67.264703 70.785214
8 172.0 65.592725 1.328836 61.857546 64.763662 65.677894 66.487480 68.277247
9 480.0 66.007394 1.580529 60.972359 64.926616 66.038725 67.097443 71.101098
10 296.0 66.155867 1.437043 61.737723 65.235841 66.207468 67.198561 69.680059
11 331.0 66.248720 1.296273 61.110400 65.387312 66.259226 67.142795 69.641148
68.0 3 288.0 68.183627 1.373385 64.056513 67.329012 68.140040 69.123926 71.789757
10 426.0 68.085070 1.407795 63.643459 67.064515 68.080357 69.080123 72.727994
11 305.0 68.004391 1.373150 63.627385 67.095708 68.004234 68.935990 72.793886
70.0 7 197.0 69.721355 1.359146 66.314193 68.756336 69.580484 70.712277 73.202534
8 338.0 69.916840 1.415914 65.713817 68.952834 69.941731 70.919702 73.990448
9 286.0 69.902900 1.397477 66.047995 68.894784 69.968917 70.915456 73.252280
11 271.0 70.016293 1.347308 66.754335 69.151855 70.022781 70.920286 74.528132
72.0 0 271.0 72.027642 1.431082 66.936883 71.158040 72.017075 72.943620 76.145625
1 151.0 71.930998 1.371406 67.348224 71.142137 71.903674 72.810174 77.410165
2 556.0 71.820791 1.418807 67.458244 70.831212 71.843111 72.728985 75.896095
76.0 3 346.0 75.743204 1.357097 71.219205 74.862230 75.682083 76.656341 80.052514
78.0 0 211.0 77.572900 1.330285 74.412900 76.813721 77.575628 78.409248 80.762279
11 305.0 77.905296 1.402996 74.273697 76.911507 77.805647 78.956095 81.591072
80.0 6 341.0 79.633885 1.432487 75.912977 78.693930 79.682296 80.639082 83.789974
82.0 0 199.0 81.712886 1.413834 77.732616 80.625056 81.713324 82.747938 85.821695
4 419.0 81.667646 1.404606 77.734237 80.799618 81.743395 82.613213 85.996090
11 314.0 81.603267 1.448089 77.392535 80.668351 81.537987 82.510234 85.361089
84.0 0 138.0 83.807975 1.365165 80.322418 82.962654 83.701981 84.610574 87.243523
3 469.0 83.804268 1.481138 80.011955 82.840476 83.795001 84.853540 87.973853
88.0 7 170.0 87.567636 1.565901 83.984887 86.419525 87.424829 88.811353 91.587071
90.0 1 147.0 89.401101 1.402853 85.335792 88.601062 89.336099 90.361381 93.254073
10 556.0 89.838160 1.403557 85.666984 88.963509 89.882519 90.791667 94.828436
92.0 10 148.0 91.569676 1.431246 87.655869 90.754352 91.614623 92.604202 94.609013
98.0 4 160.0 97.439120 1.485603 93.119022 96.541773 97.472737 98.523019 101.196266

In [52]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 300
location = pre + "/third/_280-350/2d_z_qw/quick_force_0.5/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw", zmax=40)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[52]:
[<matplotlib.lines.Line2D at 0x115bb4208>]

In [44]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 350
location = pre + "/third/_280-350/2d_z_qw/quick_temp350_force_0.3/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[44]:
[<matplotlib.lines.Line2D at 0x1a2458f3c8>]

In [43]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 350
location = pre + "/third/_280-350/2d_z_qw/quick_temp350_force_0.5/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[43]:
[<matplotlib.lines.Line2D at 0x1a1b036c18>]

In [42]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 350
location = pre + "/third/_280-350/2d_z_qw/quick_temp350/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[42]:
[<matplotlib.lines.Line2D at 0x1177655f8>]

In [23]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 310
location = pre + "/third/_280-350/2d_z_qw/quick_k_0.1/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[23]:
[<matplotlib.lines.Line2D at 0x115b755f8>]

In [18]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 290
location = pre + "/third/_280-350/2d_z_qw/quick_force_0.1/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[18]:
[<matplotlib.lines.Line2D at 0x115280550>]

In [16]:
pre = "/Users/weilu/Research/server/apr_2018/04_week"
temp = 310
location = pre + "/third/_280-350/2d_z_qw/quick/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), end=(25,24), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x10ec51ef0>
Out[16]:
[<matplotlib.lines.Line2D at 0x115c42a90>]

In [ ]:
pre = "/Users/weilu/Research/server/apr_2018/02_week"
temp = 340
location = pre + "/third_expectedEnergy/_280-350/2d_z_qw/temp_340/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(10, 10), end=(28,22), save=False, xlabel="z_H6", ylabel="Qw")
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmin=-1, zmax=-300)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)