从 python 导出的等高线图中的 Pgfplots 标签

从 python 导出的等高线图中的 Pgfplots 标签

我使用 python 绘制了很多轮廓图,并将其导出到 tikz 图形中。但是,导出 tikz 图形时,标签不会被导出。而且,无论我在线条上插入标签还是将它们添加到颜色栏,它们都不会被导出。我试图找到一个解决方案,但不幸的是,python 使用 \path 方法而不是 contourmethod 导出轮廓图,这意味着在图中添加颜色栏或标签的大多数方法都不起作用。

图表和标签太多,无法手动添加,所以我想知道是否有人知道添加图表的解决方案。我添加了一个示例 Python 导出。

This file was created by matplotlib2tikz v0.5.15.

\begin{tikzpicture}

\definecolor{color1}{rgb}{0.161290322580645,1,0.806451612903226}
\definecolor{color0}{rgb}{0,0.3,1}
\definecolor{color3}{rgb}{1,0.407407407407408,0}
\definecolor{color2}{rgb}{0.806451612903226,1,0.161290322580645}

\begin{axis}[
title={Simplest default with labels},
xmin=-3, xmax=2.80000000000001,
ymin=-2, ymax=1.8,
axis on top
]
\path [draw=blue!50.0!black] (axis cs:0.718531200553679,-0.0767608872850903)
--(axis cs:0.800000000000003,-0.179470474200398)
--(axis cs:0.815719832276248,-0.2)
--(axis cs:0.828522382496481,-0.4)
--(axis cs:0.800000000000003,-0.469417836589817)
--(axis cs:0.735009838101298,-0.6)
--(axis cs:0.600000000000003,-0.74437171077823)
--(axis cs:0.525600164994483,-0.8)
--(axis cs:0.400000000000003,-0.87363905087683)
--(axis cs:0.200000000000003,-0.940989387117833)
--(axis cs:2.66453525910038e-15,-0.962571874201965)
--(axis cs:-0.199999999999998,-0.941213000786582)
--(axis cs:-0.399999999999998,-0.874374741375032)
--(axis cs:-0.527871199326969,-0.8)
--(axis cs:-0.599999999999998,-0.747727339738553)
--(axis cs:-0.743286973637845,-0.6)
--(axis cs:-0.799999999999998,-0.506311735138795)
--(axis cs:-0.853725167440467,-0.4)
--(axis cs:-0.884274283626111,-0.2)
--(axis cs:-0.818868660883478,-4.44089209850063e-16)
--(axis cs:-0.799999999999998,0.0186881825156651)
--(axis cs:-0.599999999999998,0.168662141917144)
--(axis cs:-0.530674445631826,0.199999999999999)
--(axis cs:-0.399999999999998,0.23154068236209)
--(axis cs:-0.199999999999998,0.24904519304177)
--(axis cs:2.66453525910038e-15,0.239321434365805)
--(axis cs:0.0267921823889057,0.235036123267517);

\path [draw=color0] (axis cs:-0.210693337438727,0.475499860656936)
--(axis cs:-0.199999999999998,0.47512354764157)
--(axis cs:2.66453525910038e-15,0.451989632978374)
--(axis cs:0.200000000000003,0.415270261634482)
--(axis cs:0.262395213163633,0.399999999999999)
--(axis cs:0.400000000000003,0.360514332635342)
--(axis cs:0.600000000000003,0.292842288915109)
--(axis cs:0.800000000000003,0.219021598764685)
--(axis cs:0.850070860206972,0.199999999999999)
--(axis cs:1,0.110663085213272)
--(axis cs:1.18941088802103,-4.44089209850063e-16)
--(axis cs:1.2,-0.013169167424136)
--(axis cs:1.36548971803206,-0.2)
--(axis cs:1.4,-0.346467622575033)
--(axis cs:1.41525810991771,-0.4)
--(axis cs:1.4,-0.489444226852259)
--(axis cs:1.38199143990406,-0.6)
--(axis cs:1.29216926137998,-0.8)
--(axis cs:1.2,-0.931595584483009)
--(axis cs:1.14666573217078,-1)
--(axis cs:1,-1.1473960914153)
--(axis cs:0.934693420661718,-1.2)
--(axis cs:0.800000000000003,-1.29699727829404)
--(axis cs:0.600000000000003,-1.39852527998022)
--(axis cs:0.595839505563786,-1.4)
--(axis cs:0.400000000000003,-1.47191516525735)
--(axis cs:0.200000000000003,-1.51267039459792)
--(axis cs:2.66453525910038e-15,-1.52572140781982)
--(axis cs:-0.199999999999998,-1.51267240705617)
--(axis cs:-0.399999999999998,-1.4719207782619)
--(axis cs:-0.595871339386656,-1.4)
--(axis cs:-0.599999999999998,-1.39853707578685)
--(axis cs:-0.799999999999998,-1.2970588290035)
--(axis cs:-0.934854164251807,-1.2)
--(axis cs:-0.999999999999998,-1.14768701218976)
--(axis cs:-1.14744641730709,-1)
--(axis cs:-1.2,-0.933835512649455)
--(axis cs:-1.29554637393258,-0.8)
--(axis cs:-1.39376006649381,-0.6)
--(axis cs:-1.4,-0.579241583733314)
--(axis cs:-1.45647300500947,-0.4)
--(axis cs:-1.47217049481286,-0.2)
--(axis cs:-1.42516327473369,-4.44089209850063e-16)
--(axis cs:-1.4,0.0364003404051473)
--(axis cs:-1.28502957848119,0.199999999999999)
--(axis cs:-1.2,0.259489871073525)
--(axis cs:-0.999999999999998,0.371718283041655)
--(axis cs:-0.977742482836657,0.38087808590509);

\path [draw=color1] (axis cs:-3,0.206974385990362)
--(axis cs:-2.8,0.272249649738701)
--(axis cs:-2.6,0.343047530407831)
--(axis cs:-2.45897845826387,0.399999999999999)
--(axis cs:-2.4,0.414236302291867)
--(axis cs:-2.2,0.475884000676378)
--(axis cs:-2,0.534685582363821)
--(axis cs:-1.8,0.588367389086595)
--(axis cs:-1.75929606303811,0.6)
--(axis cs:-1.6,0.637567181209119)
--(axis cs:-1.4,0.677721334340349)
--(axis cs:-1.2,0.706952043503571)
--(axis cs:-0.999999999999998,0.724693406935834)
--(axis cs:-0.799999999999998,0.730639253156884)
--(axis cs:-0.599999999999998,0.724693406935834)
--(axis cs:-0.535064922547634,0.718933222892911);

\path [draw=color1] (axis cs:0.1294317979123,0.604700139883726)
--(axis cs:0.147941147432604,0.6)
--(axis cs:0.200000000000003,0.588367389086594)
--(axis cs:0.400000000000003,0.534685582363819)
--(axis cs:0.600000000000003,0.475884000676376)
--(axis cs:0.800000000000003,0.414236302291865)
--(axis cs:0.846589562443343,0.399999999999999)
--(axis cs:1,0.343047530407829)
--(axis cs:1.2,0.2722496497387)
--(axis cs:1.4,0.206974385990361)
--(axis cs:1.42534615679419,0.199999999999999)
--(axis cs:1.6,0.123064847075952)
--(axis cs:1.8,0.0489735860560733)
--(axis cs:1.96376189331658,-4.44089209850063e-16)
--(axis cs:2,-0.0223633857628107)
--(axis cs:2.2,-0.112411172304082)
--(axis cs:2.4,-0.180343681777905)
--(axis cs:2.48464328689722,-0.2)
--(axis cs:2.6,-0.270727216812581)
--(axis cs:2.80000000000001,-0.351488014764287);

\path [draw=color2] (axis cs:2.80000000000001,1.59508319747179)
--(axis cs:2.78414468463797,1.6)
--(axis cs:2.6,1.65659309650198)
--(axis cs:2.4,1.70263588582221)
--(axis cs:2.2,1.73581851781277)
--(axis cs:2.13644892408932,1.74299337772135);

\path [draw=color2] (axis cs:1.46226876810439,1.77513221330229)
--(axis cs:1.4,1.77428316926718)
--(axis cs:1.2,1.76364172235736)
--(axis cs:1,1.74472790945252)
--(axis cs:0.800000000000003,1.71689848682935)
--(axis cs:0.600000000000003,1.6792916183094)
--(axis cs:0.400000000000003,1.63092742517328)
--(axis cs:0.291236985088994,1.6)
--(axis cs:0.200000000000003,1.57385871739495)
--(axis cs:2.66453525910038e-15,1.50839258100721)
--(axis cs:-0.199999999999998,1.43080984143742)
--(axis cs:-0.276013716607349,1.4)
--(axis cs:-0.399999999999998,1.29769385736902)
--(axis cs:-0.515614645380936,1.2)
--(axis cs:-0.399999999999998,1.05205114513697)
--(axis cs:-0.36757320453973,0.999999999999999)
--(axis cs:-0.199999999999998,0.937900369968826)
--(axis cs:2.66453525910038e-15,0.85428099767751)
--(axis cs:0.113500409229381,0.799999999999999)
--(axis cs:0.200000000000003,0.775075045244441)
--(axis cs:0.400000000000003,0.711580024577544)
--(axis cs:0.600000000000003,0.644955318852408)
--(axis cs:0.733090187895089,0.6)
--(axis cs:0.800000000000003,0.579513531757773)
--(axis cs:1,0.520842132115612)
--(axis cs:1.2,0.46695540676496)
--(axis cs:1.4,0.420106012981296)
--(axis cs:1.50958495477461,0.399999999999999)
--(axis cs:1.6,0.379260124065904)
--(axis cs:1.8,0.34766644131992)
--(axis cs:2,0.330090567697984)
--(axis cs:2.2,0.327562237877321)
--(axis cs:2.4,0.341204591549618)
--(axis cs:2.6,0.372605415870115)
--(axis cs:2.71373184502007,0.399999999999999)
--(axis cs:2.80000000000001,0.421094767411591);

\path [draw=color3] (axis cs:2.80000000000001,1.03640584482182)
--(axis cs:2.71439495102587,1.2)
--(axis cs:2.6,1.27170039735202)
--(axis cs:2.4,1.37182319463535)
--(axis cs:2.32842504086453,1.4)
--(axis cs:2.2,1.43707617925604)
--(axis cs:2,1.47933226575322)
--(axis cs:1.8,1.50654932359061)
--(axis cs:1.6,1.52039283200359)
--(axis cs:1.4,1.52167854127354)
--(axis cs:1.2,1.51049518301688)
--(axis cs:1,1.48627528858315)
--(axis cs:0.926958185545041,1.4722384724419);

\path [draw=color3] (axis cs:0.30983895688028,1.22166775912527)
--(axis cs:0.278446654287813,1.2)
--(axis cs:0.321734454802454,0.999999999999999)
--(axis cs:0.400000000000003,0.958444737344827)
--(axis cs:0.600000000000003,0.847294356254381)
--(axis cs:0.68446413428314,0.799999999999999)
--(axis cs:0.800000000000003,0.762113914178092)
--(axis cs:1,0.701418819223192)
--(axis cs:1.2,0.648024373292493)
--(axis cs:1.4,0.605044792581313)
--(axis cs:1.43655326427328,0.6)
--(axis cs:1.6,0.579186830226458)
--(axis cs:1.8,0.56858215596522)
--(axis cs:2,0.574642750880586)
--(axis cs:2.2,0.599612298829191)
--(axis cs:2.20188275646363,0.6)
--(axis cs:2.4,0.65553243790849)
--(axis cs:2.6,0.742529288949708)
--(axis cs:2.70019673404058,0.799999999999999)
--(axis cs:2.80000000000001,0.966902368918258);

\path [draw=red!50.0!black] (axis cs:1.46411784156425,1.25794018233102)
--(axis cs:1.4,1.25922455781096)
--(axis cs:1.2,1.2393333143328)
--(axis cs:1.02904927782622,1.2)
--(axis cs:1,1.15388047040927)
--(axis cs:0.945522999470894,0.999999999999999)
--(axis cs:1,0.973751166772145)
--(axis cs:1.2,0.895105266301452)
--(axis cs:1.4,0.837798043840447)
--(axis cs:1.6,0.812796457574686)
--(axis cs:1.8,0.832918124817077)
--(axis cs:2,0.912311832999764)
--(axis cs:2.12086162875271,0.999999999999999)
--(axis cs:2.07367124095886,1.05107686936407);

\end{axis}

\end{tikzpicture}

这应该导出如下图所示:在此处输入图片描述

但导出的内容如下: 在此处输入图片描述

答案1

要手动添加标签,只需将连续轮廓的最后一个点和第一个点,或不连续轮廓两半之间间隙中的最后一个点和第一个点复制到中间有节点的新路径中。

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[font=\scriptsize]

\definecolor{color1}{rgb}{0.161290322580645,1,0.806451612903226}
\definecolor{color0}{rgb}{0,0.3,1}
\definecolor{color3}{rgb}{1,0.407407407407408,0}
\definecolor{color2}{rgb}{0.806451612903226,1,0.161290322580645}

\begin{axis}[
title={Simplest default with labels},
xmin=-3, xmax=2.80000000000001,
ymin=-2, ymax=2,% changed ymax from 1.8 to 2
axis on top
]
\path [draw=blue!50.0!black] (axis cs:0.718531200553679,-0.0767608872850903)
--(axis cs:0.800000000000003,-0.179470474200398)
--(axis cs:0.815719832276248,-0.2)
--(axis cs:0.828522382496481,-0.4)
--(axis cs:0.800000000000003,-0.469417836589817)
--(axis cs:0.735009838101298,-0.6)
--(axis cs:0.600000000000003,-0.74437171077823)
--(axis cs:0.525600164994483,-0.8)
--(axis cs:0.400000000000003,-0.87363905087683)
--(axis cs:0.200000000000003,-0.940989387117833)
--(axis cs:2.66453525910038e-15,-0.962571874201965)
--(axis cs:-0.199999999999998,-0.941213000786582)
--(axis cs:-0.399999999999998,-0.874374741375032)
--(axis cs:-0.527871199326969,-0.8)
--(axis cs:-0.599999999999998,-0.747727339738553)
--(axis cs:-0.743286973637845,-0.6)
--(axis cs:-0.799999999999998,-0.506311735138795)
--(axis cs:-0.853725167440467,-0.4)
--(axis cs:-0.884274283626111,-0.2)
--(axis cs:-0.818868660883478,-4.44089209850063e-16)
--(axis cs:-0.799999999999998,0.0186881825156651)
--(axis cs:-0.599999999999998,0.168662141917144)
--(axis cs:-0.530674445631826,0.199999999999999)
--(axis cs:-0.399999999999998,0.23154068236209)
--(axis cs:-0.199999999999998,0.24904519304177)
--(axis cs:2.66453525910038e-15,0.239321434365805)
--(axis cs:0.0267921823889057,0.235036123267517);

\path (axis cs:0.0267921823889057,0.235036123267517)
   --(axis cs:0.718531200553679,-0.0767608872850903)
   node[midway,sloped,above,inner sep=0pt] {-1000};

\path [draw=color0] (axis cs:-0.210693337438727,0.475499860656936)
--(axis cs:-0.199999999999998,0.47512354764157)
--(axis cs:2.66453525910038e-15,0.451989632978374)
--(axis cs:0.200000000000003,0.415270261634482)
--(axis cs:0.262395213163633,0.399999999999999)
--(axis cs:0.400000000000003,0.360514332635342)
--(axis cs:0.600000000000003,0.292842288915109)
--(axis cs:0.800000000000003,0.219021598764685)
--(axis cs:0.850070860206972,0.199999999999999)
--(axis cs:1,0.110663085213272)
--(axis cs:1.18941088802103,-4.44089209850063e-16)
--(axis cs:1.2,-0.013169167424136)
--(axis cs:1.36548971803206,-0.2)
--(axis cs:1.4,-0.346467622575033)
--(axis cs:1.41525810991771,-0.4)
--(axis cs:1.4,-0.489444226852259)
--(axis cs:1.38199143990406,-0.6)
--(axis cs:1.29216926137998,-0.8)
--(axis cs:1.2,-0.931595584483009)
--(axis cs:1.14666573217078,-1)
--(axis cs:1,-1.1473960914153)
--(axis cs:0.934693420661718,-1.2)
--(axis cs:0.800000000000003,-1.29699727829404)
--(axis cs:0.600000000000003,-1.39852527998022)
--(axis cs:0.595839505563786,-1.4)
--(axis cs:0.400000000000003,-1.47191516525735)
--(axis cs:0.200000000000003,-1.51267039459792)
--(axis cs:2.66453525910038e-15,-1.52572140781982)
--(axis cs:-0.199999999999998,-1.51267240705617)
--(axis cs:-0.399999999999998,-1.4719207782619)
--(axis cs:-0.595871339386656,-1.4)
--(axis cs:-0.599999999999998,-1.39853707578685)
--(axis cs:-0.799999999999998,-1.2970588290035)
--(axis cs:-0.934854164251807,-1.2)
--(axis cs:-0.999999999999998,-1.14768701218976)
--(axis cs:-1.14744641730709,-1)
--(axis cs:-1.2,-0.933835512649455)
--(axis cs:-1.29554637393258,-0.8)
--(axis cs:-1.39376006649381,-0.6)
--(axis cs:-1.4,-0.579241583733314)
--(axis cs:-1.45647300500947,-0.4)
--(axis cs:-1.47217049481286,-0.2)
--(axis cs:-1.42516327473369,-4.44089209850063e-16)
--(axis cs:-1.4,0.0364003404051473)
--(axis cs:-1.28502957848119,0.199999999999999)
--(axis cs:-1.2,0.259489871073525)
--(axis cs:-0.999999999999998,0.371718283041655)
--(axis cs:-0.977742482836657,0.38087808590509);

\path (axis cs:-0.977742482836657,0.38087808590509)
   --(axis cs:-0.210693337438727,0.475499860656936)
   node[midway,sloped,above,inner sep=0pt] {-500};

\path [draw=color1] (axis cs:-3,0.206974385990362)
--(axis cs:-2.8,0.272249649738701)
--(axis cs:-2.6,0.343047530407831)
--(axis cs:-2.45897845826387,0.399999999999999)
--(axis cs:-2.4,0.414236302291867)
--(axis cs:-2.2,0.475884000676378)
--(axis cs:-2,0.534685582363821)
--(axis cs:-1.8,0.588367389086595)
--(axis cs:-1.75929606303811,0.6)
--(axis cs:-1.6,0.637567181209119)
--(axis cs:-1.4,0.677721334340349)
--(axis cs:-1.2,0.706952043503571)
--(axis cs:-0.999999999999998,0.724693406935834)
--(axis cs:-0.799999999999998,0.730639253156884)
--(axis cs:-0.599999999999998,0.724693406935834)
--(axis cs:-0.535064922547634,0.718933222892911);

\path (axis cs:-0.535064922547634,0.718933222892911)
   --(axis cs:0.1294317979123,0.604700139883726)
   node[midway,sloped,above,inner sep=0pt] {0};

\path [draw=color1] (axis cs:0.1294317979123,0.604700139883726)
--(axis cs:0.147941147432604,0.6)
--(axis cs:0.200000000000003,0.588367389086594)
--(axis cs:0.400000000000003,0.534685582363819)
--(axis cs:0.600000000000003,0.475884000676376)
--(axis cs:0.800000000000003,0.414236302291865)
--(axis cs:0.846589562443343,0.399999999999999)
--(axis cs:1,0.343047530407829)
--(axis cs:1.2,0.2722496497387)
--(axis cs:1.4,0.206974385990361)
--(axis cs:1.42534615679419,0.199999999999999)
--(axis cs:1.6,0.123064847075952)
--(axis cs:1.8,0.0489735860560733)
--(axis cs:1.96376189331658,-4.44089209850063e-16)
--(axis cs:2,-0.0223633857628107)
--(axis cs:2.2,-0.112411172304082)
--(axis cs:2.4,-0.180343681777905)
--(axis cs:2.48464328689722,-0.2)
--(axis cs:2.6,-0.270727216812581)
--(axis cs:2.80000000000001,-0.351488014764287);

\path [draw=color2] (axis cs:2.80000000000001,1.59508319747179)
--(axis cs:2.78414468463797,1.6)
--(axis cs:2.6,1.65659309650198)
--(axis cs:2.4,1.70263588582221)
--(axis cs:2.2,1.73581851781277)
--(axis cs:2.13644892408932,1.74299337772135);

\path (axis cs:2.13644892408932,1.74299337772135)
   --(axis cs:1.46226876810439,1.77513221330229)
   node[midway,sloped,above,inner sep=0pt] {500};

\path [draw=color2] (axis cs:1.46226876810439,1.77513221330229)
--(axis cs:1.4,1.77428316926718)
--(axis cs:1.2,1.76364172235736)
--(axis cs:1,1.74472790945252)
--(axis cs:0.800000000000003,1.71689848682935)
--(axis cs:0.600000000000003,1.6792916183094)
--(axis cs:0.400000000000003,1.63092742517328)
--(axis cs:0.291236985088994,1.6)
--(axis cs:0.200000000000003,1.57385871739495)
--(axis cs:2.66453525910038e-15,1.50839258100721)
--(axis cs:-0.199999999999998,1.43080984143742)
--(axis cs:-0.276013716607349,1.4)
--(axis cs:-0.399999999999998,1.29769385736902)
--(axis cs:-0.515614645380936,1.2)
--(axis cs:-0.399999999999998,1.05205114513697)
--(axis cs:-0.36757320453973,0.999999999999999)
--(axis cs:-0.199999999999998,0.937900369968826)
--(axis cs:2.66453525910038e-15,0.85428099767751)
--(axis cs:0.113500409229381,0.799999999999999)
--(axis cs:0.200000000000003,0.775075045244441)
--(axis cs:0.400000000000003,0.711580024577544)
--(axis cs:0.600000000000003,0.644955318852408)
--(axis cs:0.733090187895089,0.6)
--(axis cs:0.800000000000003,0.579513531757773)
--(axis cs:1,0.520842132115612)
--(axis cs:1.2,0.46695540676496)
--(axis cs:1.4,0.420106012981296)
--(axis cs:1.50958495477461,0.399999999999999)
--(axis cs:1.6,0.379260124065904)
--(axis cs:1.8,0.34766644131992)
--(axis cs:2,0.330090567697984)
--(axis cs:2.2,0.327562237877321)
--(axis cs:2.4,0.341204591549618)
--(axis cs:2.6,0.372605415870115)
--(axis cs:2.71373184502007,0.399999999999999)
--(axis cs:2.80000000000001,0.421094767411591);

\path [draw=color3] (axis cs:2.80000000000001,1.03640584482182)
--(axis cs:2.71439495102587,1.2)
--(axis cs:2.6,1.27170039735202)
--(axis cs:2.4,1.37182319463535)
--(axis cs:2.32842504086453,1.4)
--(axis cs:2.2,1.43707617925604)
--(axis cs:2,1.47933226575322)
--(axis cs:1.8,1.50654932359061)
--(axis cs:1.6,1.52039283200359)
--(axis cs:1.4,1.52167854127354)
--(axis cs:1.2,1.51049518301688)
--(axis cs:1,1.48627528858315)
--(axis cs:0.926958185545041,1.4722384724419);

\path (axis cs:0.926958185545041,1.4722384724419)
   --(axis cs:0.30983895688028,1.22166775912527)
   node[midway,sloped,above,inner sep=0pt] {1000};

\path [draw=color3] (axis cs:0.30983895688028,1.22166775912527)
--(axis cs:0.278446654287813,1.2)
--(axis cs:0.321734454802454,0.999999999999999)
--(axis cs:0.400000000000003,0.958444737344827)
--(axis cs:0.600000000000003,0.847294356254381)
--(axis cs:0.68446413428314,0.799999999999999)
--(axis cs:0.800000000000003,0.762113914178092)
--(axis cs:1,0.701418819223192)
--(axis cs:1.2,0.648024373292493)
--(axis cs:1.4,0.605044792581313)
--(axis cs:1.43655326427328,0.6)
--(axis cs:1.6,0.579186830226458)
--(axis cs:1.8,0.56858215596522)
--(axis cs:2,0.574642750880586)
--(axis cs:2.2,0.599612298829191)
--(axis cs:2.20188275646363,0.6)
--(axis cs:2.4,0.65553243790849)
--(axis cs:2.6,0.742529288949708)
--(axis cs:2.70019673404058,0.799999999999999)
--(axis cs:2.80000000000001,0.966902368918258);

\path [draw=red!50.0!black] (axis cs:1.46411784156425,1.25794018233102)
--(axis cs:1.4,1.25922455781096)
--(axis cs:1.2,1.2393333143328)
--(axis cs:1.02904927782622,1.2)
--(axis cs:1,1.15388047040927)
--(axis cs:0.945522999470894,0.999999999999999)
--(axis cs:1,0.973751166772145)
--(axis cs:1.2,0.895105266301452)
--(axis cs:1.4,0.837798043840447)
--(axis cs:1.6,0.812796457574686)
--(axis cs:1.8,0.832918124817077)
--(axis cs:2,0.912311832999764)
--(axis cs:2.12086162875271,0.999999999999999)
--(axis cs:2.07367124095886,1.05107686936407);

\path (axis cs:2.07367124095886,1.05107686936407)
   --(axis cs:1.46411784156425,1.25794018233102)
   node[midway,sloped,above,inner sep=0pt] {1500};

\end{axis}

\end{tikzpicture}
\end{document}

演示

相关内容