编译和着色挑战时出错

编译和着色挑战时出错

我有以下担忧:

1- 我画了两幅图,我需要将它们放在彼此的下方。第一幅图呈现的是哈斯图,第二幅图呈现的是线偏序集。当我将它们放在单独的文件中时,一切都运行良好,但一旦将它们合并在一起,就无法正常工作。您能给我一些建议吗?

2- 我被困在画两张上传的照片上的阴影上。你能帮我吗?这是我的尝试

\documentclass{article}

   \usepackage{tikz}
  \usetikzlibrary{positioning}
 \tikzset{mynode/.style={draw,circle,inner sep=2pt,outer sep=2pt}
  }

  \begin{document}
   \begin{center}
    \begin{tikzpicture}

  \node [mynode,label=above:u] (u) at (0,0) {};
  \node [mynode,below left  = of u,label=left:e] (e)  {};
  \node [mynode,below right = of u,label=right:f] (f) {};
  \node [mynode,below right = of e,label=below:d] (d) {};
  \node [mynode,above right = of u,label=right:r] (r) {};
  \node [mynode,above left = of e,label=left:m] (m) {};
  \node [mynode,below left = of e,label=left:n] (n) {};
  \node [mynode,above right = of m,label=left:s] (s) {};
  \node [mynode,above right = of s,label=left:w] (w) {};

  \draw (u) -- (e) 
        (u) -- (f) 
        (e) -- (d) 
        (f) -- (d)
        (r) -- (u)
        (m) -- (e)
        (e) -- (n)
        (m) -- (s)
        (w) -- (s)
        (w) -- (r)
        (s) -- (u);

\end{tikzpicture}  
   \end{center}

 \definecolor{zzttqq}{rgb}{0.6,0.2,0.}
 \definecolor{qqqqtt}{rgb}{0.,0.,0.2}
   \begin{figure}[ht]

 \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,scale=1.3]
 \draw(0.,0.) circle (0.2cm);
\draw(0.,1.3) circle (0.2cm);
 \draw(0.,2.6) circle (0.2cm);
\draw(0.,4) circle (0.2cm);
 \draw (0.,3.6)-- (0.,3.0)[dotted];
 \draw (0.,2.4)-- (0.,1.5);
 \draw (0.,1.1)-- (0.,0.2);
 \draw (-1.6,5.7) node[anchor=north west] {$ J_{(n)}$};
 \draw (-1.6,4.4) node[anchor=north west] {$ J_{(k)}$};
 \draw (-1.6,3.) node[anchor=north west] {$ J_{(2)}$};
  \draw (-1.6,1.7) node[anchor=north west] {$ J_{(1)}$};
  \draw (-1.3,0.3) node[anchor=north west] {$ J_{0}$};
  \draw(0.,5.4) circle (0.2cm);
   \draw (0.,5.0)-- (0.,4.4)[dotted];
   \end{tikzpicture}
   \end{figure}
    \end{document}

在此处输入图片描述

答案1

正如@hpekristiansen在评论中提到的,三角形45箭头尖端是导致编译错误的原因。由于您未包含库,因此尖端未知arrows。对于您的另一个问题,我“精简”了您的代码并添加了一些图案\filldraw。我假设图形必须彼此居中,如果下方图形必须与d顶部图形的节点对齐,请告诉我。

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning,arrows,patterns}
\tikzset{
    mynode/.style={draw,circle,inner sep=2pt,outer sep=2pt,fill=white}
}

\definecolor{zzttqq}{rgb}{0.6,0.2,0.}
\definecolor{qqqqtt}{rgb}{0.,0.,0.2}

\begin{document}
    \begin{figure}[ht]
        \centering
        \begin{tikzpicture}
        
        \node [mynode,label=above:u] (u) at (0,0) {};
        \node [mynode,below left  = of u,label=below:e] (e)  {};
        \node [mynode,below right = of u,label=right:f] (f) {};
        \node [mynode,below right = of e,label=below:d] (d) {};
        \node [mynode,above right = of u,label=right:r] (r) {};
        \node [mynode,above left = of e,label=left:m] (m) {};
        \node [mynode,below left = of e,label=left:n] (n) {};
        \node [mynode,above right = of m,label=left:s] (s) {};
        \node [mynode,above right = of s,label=left:w] (w) {};
        
        \draw (u) -- (e) 
            (u) -- (f) 
            (e) -- (d) 
            (f) -- (d)
            (r) -- (u)
            (m) -- (e)
            (e) -- (n)
            (m) -- (s)
            (w) -- (s)
            (w) -- (r)
            (s) -- (u);
            
        \begin{scope}[shift={(e)}]
            %\filldraw[domain=-45:45,pattern=crosshatch dots,pattern color=gray] plot ({\x/10},{14*(-cos(\x)+1)});
            \filldraw[pattern=crosshatch dots,pattern color=gray] (-3.5,4) to[in=180,out=280] (0,0) to[in=260,out=0] (3.5,4);
        \end{scope}
        
        \end{tikzpicture}
    
        \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,mycircle/.style={draw,circle,minimum size=5.2mm}]
            \begin{scope}[scale=1.69]
            
                \filldraw[pattern = crosshatch dots,pattern color=gray] (-0.75,5.5) -- (-0.75,3) arc (180:360:0.75) -- (0.75,5.5);
                \filldraw[pattern = crosshatch dots,pattern color=gray] (-0.75,-0.5) -- (-0.75,1) arc (180:0:0.75) -- (0.75,-0.5);
                
                \node[mycircle,label=left:\( J_{0} \),label={[label distance=1cm]right:my additional label}] (J0) at (0,0) {};
                \node[mycircle,label=left:\( J_{(1)} \)] (J1) at (0,1) {};
                \node[mycircle,label=left:\( J_{(2)} \)] (J2) at (0,3) {};
                \node[mycircle,label=left:\( J_{(k)} \)] (Jk) at (0,4) {};
                \node[mycircle,label=left:\( J_{(n)} \)] (Jn) at (0,5) {};
                
                \begin{scope}[shorten <=2mm,shorten >=2mm,dotted]
                    \draw (Jn) -- (Jk);
                    \draw (Jk) -- (J2);
                \end{scope}
                \draw (J0) -- (J1);
                \draw (J1) -- (J2);
                
            \end{scope}
        \end{tikzpicture}
    \end{figure}
\end{document}

其结果是

在此处输入图片描述

更新:

J0根据评论中的要求,略微减小了顶部图形图案区域的尺寸,并添加了附加标签。

在此处输入图片描述

相关内容