连续图中填充背景错误

连续图中填充背景错误

我有这个带有 const 图的 pgplot。想法是西北方向的第一个区域(实际上是背景)完全是绿色。然后第二个区域应该是蓝色,第三个区域应该是白色。如您所见,在使用背景色绿色填充蓝色区域时,有一些噪音……我不知道会发生什么。我将不胜感激任何帮助!

我在下面添加了图和我正在使用的代码。 在此处输入图片描述

\begin{adjustbox}{width=0.6\linewidth} 
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=1.5,xmin=0.650756396219793
,xmax=1.53525871598697,
axis background/.style={fill=green},xlabel=$y$, ylabel=$d$]

\addplot
    [const plot,fill=blue,draw=black] 
coordinates%30pp
{
(0.650756396219793,0.301507537688442)
(0.662255930630742, 0.316582914572864)
(0.673958673634702, 0.324120603015075)
(0.685868216136382, 0.339195979899498)
(0.697988212495470, 0.361809045226131)
(0.710322381647943, 0.369346733668342)
(0.722874508247201, 0.391959798994975)
(0.735648443825360, 0.422110552763819)
(0.748648107975067, 0.444723618090452)
(0.761877489552200, 0.467336683417085)
(0.775340647899819, 0.497487437185930)
(0.789041714093750, 0.527638190954774)
(0.802984892210175, 0.550251256281407)
(0.817174460615623, 0.580402010050251)
(0.831614773279756, 0.618090452261307)
(0.846310261111356, 0.648241206030151)
(0.861265433317920, 0.685929648241206)
(0.876484878789271, 0.723618090452261)
(0.891973267505638, 0.761306532663317)
(0.907735351970595, 0.806532663316583)
(0.923775968669344, 0.844221105527638)
(0.940100039552749, 0.889447236180905)
(0.956712573547606, 0.934673366834171)
(0.973618668093594, 0.979899497487437)
(0.990823510707393, 1.01758793969849)
(1.00833238057443,  1.07035175879397)
(1.02615065016878,  1.11557788944724)
(1.04428378690164,  1.16080402010050)
(1.06273735479898,  1.20603015075377)
(1.08151701620885,  1.25879396984925)
(1.10062853353878,  1.31155778894472)
(1.12007777102400,  1.37185929648241)
(1.13987069652677,  1.42462311557789)
(1.16001338336763,  1.48492462311558)
(1.18051201218893,  1.50000000000000)
(1.20137287285133,  1.60000000000000)
(1.22260236636378,  1.50000000000000)
(1.24420700684765,  1.50000000000000)
(1.26619342353553,  1.50000000000000)
(1.28856836280535,  1.50000000000000)
(1.31133869025048,  1.50000000000000)
(1.33451139278639,  1.50000000000000)
(1.35809358079453,  1.50000000000000)
(1.38209249030407,  1.50000000000000)
(1.40651548521229,  1.50000000000000)
(1.43137005954408,  1.50000000000000)
(1.45666383975146,  1.50000000000000)
(1.48240458705369,  1.50000000000000)
(1.50860019981877,  1.50000000000000)
(1.53525871598697,  1.50000000000000)
};
    \closedcycle;
     \addplot
[const plot,fill=white,draw=black] 
coordinates%base 0.293969849246231)
{
(0.650756396219793,0.301507537688442)
(0.662255930630742, 0.309045226130653)
(0.673958673634702, 0.316582914572864)
(0.685868216136382, 0.324120603015075)
(0.697988212495470, 0.331658291457286)
(0.710322381647943, 0.331658291457286)
(0.722874508247201, 0.339195979899498)
(0.735648443825360, 0.346733668341709)
(0.748648107975067, 0.346733668341709)
(0.761877489552200, 0.361809045226131)
(0.775340647899819, 0.376884422110553)
(0.789041714093750, 0.399497487437186)
(0.802984892210175, 0.414572864321608)
(0.817174460615623, 0.437185929648241)
(0.831614773279756, 0.459798994974874)
(0.846310261111356, 0.482412060301508)
(0.861265433317920, 0.512562814070352)
(0.876484878789271, 0.535175879396985)
(0.891973267505638, 0.565326633165829)
(0.907735351970595, 0.595477386934673)
(0.923775968669344, 0.633165829145729)
(0.940100039552749, 0.663316582914573)
(0.956712573547606, 0.701005025125628)
(0.973618668093594, 0.738693467336683)
(0.990823510707393, 0.776381909547739)
(1.00833238057443,  0.814070351758794)
(1.02615065016878,  0.859296482412060)
(1.04428378690164,  0.904522613065327)
(1.06273735479898,  0.949748743718593)
(1.08151701620885,  1.00251256281407)
(1.10062853353878,  1.05527638190955)
(1.12007777102400,  1.10804020100503)
(1.13987069652677,  1.16080402010050)
(1.16001338336763,  1.22110552763819)
(1.18051201218893,  1.28894472361809)
(1.20137287285133,  1.34924623115578)
(1.22260236636378,  1.41708542713568)
(1.24420700684765,  1.49246231155779)
(1.26619342353553,  1.50000000000000)
(1.28856836280535,  1.50000000000000)
(1.31133869025048,  1.50000000000000)
(1.33451139278639,  1.50000000000000)
(1.35809358079453,  1.50000000000000)
(1.38209249030407,  1.50000000000000)
(1.40651548521229,  1.50000000000000)
(1.43137005954408,  1.50000000000000)
(1.45666383975146,  1.50000000000000)
(1.48240458705369,  1.50000000000000)
(1.50860019981877,  1.50000000000000)
(1.53525871598697,  1.50000000000000)
} 
    \closedcycle;
    \node at (axis cs:0.8,1) 
            {\large \textcolor{black}{$z'=1$}};
    \node at (axis cs:1.3,0.5) 
            {\large \textcolor{black}{$z'=0$ }};
\end{axis}
\end{tikzpicture}
\end{adjustbox}

答案1

您的代码在编译时确实会产生错误。还有其他错误,您可以从重新编译按钮旁边带有数字 13 的小红框​​中看到。如果出现错误,应始终进行修复(单击 13 以获取更多信息),否则您不能依赖输出。

;也就是说,你只是忘记在关闭}第一个图的坐标列表后删除,所以你有

};  %<--- this semicolon must be removed
    \closedcycle;

删除分号,它似乎工作正常。

相关内容