要做的图

要做的图

我需要准确地重现这个数字,但我没有得到相同的结果。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{center}
        \definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
            \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
            \definecolor{qqqqff}{rgb}{0,0,1}
            \begin{tikzpicture}[
            line cap=round,
            line join=round,
            >=stealth,
            lbl/.style={draw,circle},
        %   x=1cm,y=1cm
            ]
            \coordinate[label=below left:] (A) at (0,0);
            \coordinate[label=below left:] (B) at (6,0);
            \coordinate[label=below left:] (C) at (0,3.35);
            \coordinate[label=below left:] (D) at (-3,1);
            \coordinate[label=below left:] (E) at (-2,2);
            \coordinate[label=below left:] (F) at (2.66,1.51);
            \coordinate[label=below left:] (G) at (2.88,0.75);
            \coordinate[label=below left:] (H) at (1.52,-1.35);
            \coordinate[label=below left:] (I) at (-1.78,-0.91);
            \coordinate[label=below left:] (J) at (-2.84,-0.09);
            \coordinate[label=below left:] (K) at (-3.1,0.39);

            \draw [->,line width=0.8pt] (A) -- (B) node[midway, above] {};

            \draw [->,line width=0.8pt] (A) -- (C) node[midway, above] {};

            \draw [-,line width=0.8pt] plot [smooth, tension=1] coordinates {(D) (E) (F)};

            \draw [-,line width=0.8pt] plot [smooth, tension=1] coordinates {(F) (G) (H)};

            \draw [-,line width=0.8pt] plot [smooth, tension=1] coordinates {(H) (I) (J)};

            \draw [-,line width=0.8pt] plot [smooth, tension=1] coordinates {(J) (K) (D)};

            
            %\node[text width=6.2cm] at (1,2) {$\partial \mathbb{S}$};
         \end{tikzpicture}
    \end{center}

\end{document}

结果 :

在此处输入图片描述

答案1

这是实现此目的的方法。一些备注:

  • 在 pgfmanual 中查找我使用的所有命令
  • 定义并使用更多合适的样式,以简化代码和重用
  • 建议:多发表一些评论,也为了你自己
  • 你没有使用定义的颜色......
  • 我会删除该区域的坐标;参见从简单开始下一步完善
  • 通过调整in- 和out- 角度,你可以得到令人惊讶的结果,包括边缘(尝试一下)
  • 将锚点置于 x 轴和 y 轴的节点上
  • 对于数学标签,我使用了两个快捷方式\ms\fs
  • 您需要加载\usepackage{amsfonts,amsmath}才能显示它们
  • 对于初学者来说,对 sigma 进行双下划线很难;请参阅评论中的两个链接;我的是基于这些的近似值

结果

\documentclass{article}
\usepackage{tikz}
\usepackage{amsfonts,amsmath}


% ~~~ redefining \vec ~~~~~~~~~~~
%     see: https://tex.stackexchange.com/questions/561255/in-math-mode-underline-adjacent-variables-except-with-space-between-underlines
%     see: https://tex.stackexchange.com/questions/649142/double-underline-notation-for-matrices-and-single-underline-notation-for-vectors

\renewcommand\vec[1]{%
  \mspace{2mu}%
  \underline{\mspace{-2mu}#1\mspace{-8mu}}%
  \mspace{2mu}%
}

% ~~~ shortcuts ~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\ms[0]{\mathbb{S}}
\newcommand\fs[0]{f(\vec{\sigma)}}


\begin{document}

\begin{center}
%   \definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
%   \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
%   \definecolor{qqqqff}{rgb}{0,0,1}
    
    \begin{tikzpicture}[
        line cap=round,
        line join=round,
        >=stealth,
        lbl/.style={draw,circle},
        lne/.style={line width=0.8pt},
        area/.style={lne, fill=teal!50},%,rounded corners},
        %   x=1cm,y=1cm
        ]
        % ~~~ for the axes ~~~~~~~~~~~~
        \coordinate[label=below left:] (A) at (0,0);
        \coordinate[label=below left:] (B) at (4,0);
        \coordinate[label=below left:] (C) at (0,3.35);
        
        % ~~~ for the area ~~~~~~~~~~~~~~~
        %     obsolete with my approach
%       \coordinate[label=below left:] (D) at (-3,1);
%       \coordinate[label=below left:] (E) at (-2,2);
%       \coordinate[label=below left:] (F) at (2.66,1.51);
%       \coordinate[label=below left:] (G) at (2.88,0.75);
%       \coordinate[label=below left:] (H) at (1.52,-1.35);
%       \coordinate[label=below left:] (I) at (-1.78,-0.91);
%       \coordinate[label=below left:] (J) at (-2.84,-0.09);
%       \coordinate[label=below left:] (K) at (-3.1,0.39);
        
        % ~~~ area ~~~~~~~~~~~~
        %     works with your data, but ...
%       \draw[area] (D) -- (E) -- (F) -- (G) -- (H) -- 
%                   (I) -- (J) -- (K) -- cycle;
        
        % ~~~ start simple ~~~~~~~~~~~~~~~~~~~~~~~
%       \draw[area] (-2,0) -- (.4,2) -- (2,0) -- (-.5,-1.5) -- cycle;
        
        % ~~~ next refine ~~~~~~~~~~~~~~~~~~~~~~~
        \draw[area] (-2,0)  to[out=90,in=180] (.4,2) to[out=0,in=90] (2,0)
                            to[out=-90,in=00] (-.5,-1.5) 
                            to[out=180,in=-90] cycle;
        
        % ~~~ axes ~~~~~~~~~~~~~~~~~~~
        \draw [->,lne] (A) -- (B) node[anchor=west] {$\sigma_{kl}$};        
        \draw [->,lne] (A) -- (C) node[anchor=south] {$\sigma_{ij}$};
    
        % ~~~ missing labels ~~~~~~~~~~~~~~~~~~~~
        \node at (.5, .5) {$\ms$};      
        \node at (.5,-.5) {$\fs \le 0$};        
        
        \node[align=center] at (1,2) {$\partial \mathbb{S}$\\$\fs = 0$};
    \end{tikzpicture}
  \end{center}
\end{document}

相关内容