tikzpicture가 실패하는 이유에 대한 조언이 있습니까?

tikzpicture가 실패하는 이유에 대한 조언이 있습니까?

다음을 실행 중인데 작동하지 않는 것 같습니다. 무엇이 잘못되고 있는지에 대한 조언이 있습니까?

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\begin{document} 
\begin{center} 
\begin{tikzpicture}
    \begin{groupplot}[group style={group size= 2 by 1},height=6cm,width=6cm,xmin=0.5,ymin=0.4999,ymax=1.0001,xmax=1,samples=500,ytick={0.5,1},xtick={0.5,1}, xlabel={$v_1$},
    axis lines=left]
        \nextgroupplot[title={}, ylabel={$x_1$}]
              \addplot[blue,]{min(1,(\x/(2*(1-min(1,\x)))))};\label{plots:plot1};   

              \addplot[black] {max(0,min((3*\x-1)/(2*\x),1))};\label{plots:plot2};
                \addplot[black, dashed] {(\x)};\label{plots:plot3};
         \nextgroupplot[title={}, ylabel={}]
              \addplot[blue]{max(min((2-3*\x)/(2-2*\x),1),0)};\label{plots:plot4};  

              \addplot[black] {};\label{plots:plot5};
                \addplot[black, dashed] {1-\x};\label{plots:plot6};
                \coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot
                \coordinate (bot) at (rel axis cs:1,0);% coordinate at bottom of the last plot
    \end{groupplot}
    \path (top-|current bounding box.west)-- 
          node[anchor=south,rotate=90] { } 
          (bot-|current bounding box.west); % legend \path (top|-current bounding box.south)--
      coordinate(legendpos) 
      (bot|-current bounding box.south); \matrix[
    matrix of nodes,
    anchor=north,
    draw,
    inner sep=0.2em,
    draw   ]at([yshift=-1ex, xshift=-17ex]legendpos)   {
    \ref{plots:plot1}& player 1 moves first&[5pt]
    \ref{plots:plot2}& player 2 moves first&[5pt]
    \ref{plots:plot3}& players move simultaneously& \\}; 
    \end{tikzpicture} 
    \end{center}
    \end{document}

답변1

몇 가지 문제가 있습니다.

  1. 함수 에서는 x가 아니라 를 사용해야 합니다 .\xpgfplots
  2. 오류가 발생하는 이유는 모든 항목을 주석 처리한 다음 하나만 주석 처리를 제거하면 찾을 수 있습니다 \addplot.

    \addplot[black] {};\label{plots:plot5};
    

불법입니다. 여기에 무슨 음모를 꾸미고 싶은지 모르겠습니다...

(PS: 경고를 확인하고 \pgfplotsset{compat=1.15}패키지의 최신 기능을 사용하려면 무엇이든 추가하세요).

관련 정보