等高线图与来自3列的数据

时间:2019-07-18 10:51:46

标签: python python-3.x matplotlib

所以我有2个不同的数据集RMSD和Energy。 RMSD具有100帧X 48温度。能量具有100帧X 48温度。我在下面提供了一些数据。

每列的温度都在260K-500K之间,因此如上所述,我有48个温度。

temperature = np.linspace(260,500,48).reshape(48,1)

def calculate_delta_G(xf):
    xf[xf==0] = 0.001
    xf[xf==1] = 0.999
    temp_log = np.log((1-xf)/xf)
    ener = -temp_log
    return ener

energy = calculate_delta_G(xf)

我想将能量绘制成RMSD和温度的函数。

X轴= RMSD,Y轴=温度,Z轴=能量。

能量(xf)

0.88 0.81 0.81 0.88 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.81 0.87 0.31 0.81 0.81 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.88 0.28 0.81 0.81 0.25 0.25 0.81 0.81 0.81 0.25 0.31 0.81 0.75 0.81 0.31 0.29 0.19 0.81 0.31 0.81 0.25
0.88 0.81 0.81 0.88 0.81 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.81 0.87 0.31 0.81 0.81 0.81 0.88 0.81 0.81 0.86 0.87 0.75 0.25 0.88 0.81 0.25 0.75 0.79 0.88 0.25 0.88 0.31 0.75 0.25 0.81 0.81 0.31 0.31 0.19 0.75 0.25 0.81 0.25
0.88 0.81 0.81 0.81 0.88 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.81 0.87 0.81 0.81 0.81 0.81 0.31 0.88 0.81 0.81 0.81 0.75 0.87 0.88 0.25 0.81 0.25 0.81 0.75 0.25 0.88 0.88 0.31 0.75 0.81 0.25 0.25 0.81 0.31 0.19 0.75 0.25 0.25 0.81
0.88 0.81 0.81 0.81 0.88 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.79 0.31 0.88 0.81 0.81 0.81 0.75 0.81 0.88 0.25 0.25 0.81 0.81 0.75 0.25 0.88 0.88 0.31 0.75 0.81 0.25 0.31 0.75 0.19 0.25 0.25 0.75 0.81 0.25
0.88 0.81 0.81 0.81 0.88 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.81 0.87 0.81 0.81 0.81 0.81 0.88 0.31 0.81 0.81 0.81 0.81 0.81 0.25 0.88 0.31 0.81 0.81 0.75 0.25 0.88 0.88 0.31 0.81 0.25 0.81 0.76 0.31 0.19 0.31 0.75 0.81 0.25 0.25
0.81 0.81 0.88 0.81 0.88 0.88 0.81 0.81 0.75 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.87 0.81 0.25 0.81 0.81 0.79 0.81 0.81 0.88 0.25 0.81 0.25 0.75 0.25 0.87 0.87 0.31 0.75 0.25 0.81 0.79 0.25 0.19 0.75 0.81 0.25 0.25 0.25
0.88 0.81 0.81 0.88 0.81 0.88 0.81 0.75 0.81 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.25 0.88 0.81 0.81 0.81 0.81 0.87 0.81 0.87 0.31 0.81 0.25 0.81 0.25 0.88 0.31 0.87 0.81 0.81 0.25 0.81 0.19 0.31 0.75 0.31 0.81 0.25 0.25
0.88 0.81 0.88 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.25 0.81 0.81 0.81 0.81 0.81 0.81 0.31 0.88 0.81 0.25 0.25 0.75 0.88 0.81 0.31 0.81 0.81 0.25 0.25 0.81 0.31 0.75 0.25 0.81 0.25 0.25
0.88 0.81 0.81 0.88 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.88 0.84 0.81 0.81 0.87 0.83 0.81 0.81 0.81 0.88 0.25 0.81 0.81 0.81 0.81 0.81 0.81 0.87 0.25 0.25 0.81 0.75 0.25 0.88 0.31 0.88 0.81 0.81 0.25 0.81 0.19 0.21 0.75 0.25 0.81 0.25 0.25
0.88 0.81 0.81 0.88 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.88 0.74 0.25 0.81 0.81 0.81 0.87 0.81 0.81 0.30 0.25 0.81 0.25 0.81 0.88 0.31 0.87 0.81 0.81 0.25 0.81 0.19 0.25 0.81 0.19 0.31 0.81 0.25

RMSD(第一列是帧号/序列号)

19991  0.618793574  1.12074848  1.02808325  1.08683459  0.866310174  0.911906693  1.30381795  1.82816707  1.44472654  1.07542273  1.02941825  1.41460516  1.16972179  1.72095818  0.652915943  1.51596462  0.926598447  3.8378541  1.51121686  0.927422672  1.16718848  1.14295316  0.885107627  1.4300892  1.07371318  1.21248621  0.923641168  0.548406496  5.82068002  0.887513918  1.46950834  6.19428616  7.5820221  1.22756685  0.810412382  1.10814912  9.05285243  4.96694512  1.1948647  1.32979153  1.32644914  5.50620036  7.75859753  7.8314886  1.78770472  5.14910281  1.34635928  8.27916961
19992  0.6190783  1.23882954  1.0294775  1.17833384  1.3843293  0.899015298  1.65335552  0.728016348  0.998450504  1.17164194  1.78168314  1.45213638  1.26158756  0.995183516  0.769488127  1.45734982  0.962851547  3.52599637  1.07657635  1.38301564  1.08219939  0.883391754  1.13574262  1.1963314  1.32275109  0.717983932  1.36844093  5.6387985  0.779769917  1.23874113  6.13444872  1.43963756  1.31952926  0.671831002  7.81900501  1.09688508  4.34418033  1.46815061  9.21317307  1.16844407  1.27774277  8.37118637  5.28266069  7.56442105  1.96236598  4.67302096  1.12320952  7.85519674
19993  0.598022241  1.19158029  1.04469129  1.31269406  1.1255421  0.891145109  0.681156577  1.75049303  0.977697361  1.36358461  1.35600992  1.60017882  1.3172798  0.812639799  1.10659831  0.798468473  1.01188512  1.37574503  1.52921602  1.10502663  3.46191559  0.836583532  1.04883331  1.43988441  1.16899727  1.31143778  0.72071088  0.567437765  5.73816066  1.26524268  6.35919111  1.24806983  1.37090317  8.04700916  0.844505219  0.897270877  4.85765112  1.46964813  1.13397676  9.18564858  8.8766122  1.05524345  5.77807153  7.53590262  1.83671172  5.23944461  7.88842678  1.05092523
19994  0.635160228  1.11823128  1.33195743  0.977060132  1.06748768  0.778323878  1.77113962  0.894461913  0.9916443  1.35419389  1.44858808  1.82492844  1.12391337  1.12412033  0.88478564  0.946661102  1.49848831  0.875328837  1.18906908  1.73486011  4.11865863  1.03764807  1.18911647  1.38820353  0.952912603  1.31117638  0.729247919  0.673595396  5.54045267  6.17006944  1.02840385  1.38723133  1.47123503  7.66451717  0.668963933  0.812348298  4.8149816  1.48273971  1.21571293  8.36258862  8.59330159  1.28526308  7.7676773  5.66143942  8.37938933  1.71508451  1.46676601  4.93049835
19995  0.680951566  1.04809412  1.24490059  1.16933298  1.20221742  0.90435385  0.925138204  1.03536374  1.89162766  1.71891521  1.32600356  1.50993453  1.04443682  0.767556136  0.987849776  0.767733684  0.951025849  1.4056759  1.22130171  1.67128197  1.06243663  3.92663937  1.3564439  1.17280944  1.26293413  0.800090311  1.29637773  5.76360469  0.681333816  5.69659755  1.28244871  1.28222765  1.41785841  7.69885701  0.783839975  0.807357933  4.88545879  1.15044476  8.80913827  1.24140757  1.3800232  9.04560581  7.71008146  5.650438  1.71964011  1.40779415  8.03948976  5.24952623
19996  1.06576333  1.23602251  0.552638696  1.16114786  1.07331766  1.02213229  0.885441571  1.03636252  1.83381138  1.39579641  1.72047103  0.718358472  1.4480975  1.10164063  1.0224124  0.889966272  1.03215027  1.49957106  1.4604068  1.16300417  1.05394583  1.12099298  4.17176425  1.10248557  1.36178127  1.44722151  0.770884519  1.12599287  0.506551508  5.21852007  1.25788059  6.04067221  1.43109369  7.64497902  0.993986558  0.857380526  4.89844726  1.10033702  9.3403556  1.32575278  1.441501  8.58263351  7.86371207  1.80972131  1.43110579  5.97208734  8.13861139  5.39393668
19997  0.608599804  0.909995359  1.30701396  1.16141839  1.19087999  0.865927878  0.775998256  1.85953123  1.00567972  1.36040182  1.74910303  0.701992928  1.47629807  1.03703968  1.03900607  0.901663175  0.966119717  1.32423378  1.07170699  1.47686645  4.02903282  0.907029698  1.10251654  0.906818921  1.3954855  1.40848419  0.725203072  1.01196386  0.662743046  5.33198049  1.24018097  6.13310077  1.36938349  8.03657978  1.02372788  4.94822877  0.904856708  1.05248311  1.19236526  9.4324226  1.21431961  7.71252446  8.65196326  1.59810873  5.65240318  1.14461327  8.08307925  5.54942645
19998  0.671975637  1.01819619  1.04541894  1.31007955  1.06925033  0.900323963  0.956278482  1.78719952  1.30174568  0.937511504  0.642219142  1.4832748  1.61965706  1.03208094  0.997528021  0.856188644  1.03925172  1.45162295  1.03613905  1.69372531  0.862827476  4.03379855  1.06997511  0.985962653  1.52107345  1.6876677  0.740032567  0.944514364  5.657672  0.596563109  1.20527166  6.39076728  7.93848809  1.38398614  1.05840859  0.921390446  5.08730541  1.15897496  1.39957341  9.671631  7.985792  1.28820486  8.42056317  1.67840191  6.08248737  1.19050922  5.34385969  8.85479236
19999  0.647574831  1.42089138  0.988980567  1.11599984  1.2276441  0.994940473  0.909065939  1.77801378  1.46860902  1.35921315  0.999313796  0.821732995  1.60540848  0.976482005  1.09775938  0.76265545  1.15852864  1.53317243  1.13746767  1.40950533  0.885732326  4.05376803  1.47580248  0.945424269  1.10302355  1.55427687  0.798906647  1.00536268  0.561667404  5.19638584  6.34062069  1.28925732  1.22555655  8.60017749  1.00312422  4.81296568  0.828341598  1.24475428  1.19722737  9.33890163  1.26595366  7.76920714  5.91514791  1.56366249  8.67069511  1.20757628  5.27165199  8.48421026
20000  0.682454313  1.40329196  1.06719088  1.15461173  0.909979547  1.24780416  0.95290591  1.96060517  0.913311788  1.43957084  1.51376625  0.702303221  1.10208145  0.915363059  0.944937993  1.70182377  1.02061679  1.32047736  1.13045645  1.48085474  0.898282987  1.47288641  4.01282401  0.905476889  0.862808301  1.44506408  0.526003815  1.05835514  0.775093172  5.44135888  6.2914095  1.30883642  8.714628  1.25902851  1.10775398  4.54822147  0.801863426  1.16420706  1.25576706  9.22078396  1.3986003  7.60627513  6.11255608  1.66843368  5.18380296  8.63971031  1.55994182  8.05980672

enter image description here

编辑1

我已经阅读了这篇文章。

  1. https://stackoverflow.com/a/20458202/5202279
  2. https://stackoverflow.com/a/42502583/5202279
  3. https://stackoverflow.com/a/52302755/5202279

但是我在griddata步骤中遇到了错误。

也请阅读此https://matplotlib.org/gallery/images_contours_and_fields/irregulardatagrid.html

0 个答案:

没有答案