有谁能帮我画这个吗?

有谁能帮我画这个吗?

**在此输入图片描述**

我是 tikz 新手,画这个图时遇到了麻烦。我尝试了网上的几种解决方案,但由于曲线的间隔很小(但这里没有显示),所以没有什么效果。有人能帮帮我吗?

答案1

你可以绘制参数图。在这种情况下,我发现将所有幂应用到一个x坐标上更容易,比如说,

\draw[orange,ultra thick] plot[domain=-4:4,smooth] ({sign(\x)*pow(abs(\x),5/3)/2.5},\x);

因为确定域更容易。$x_2^5=x_1^3$位于一个非常特殊的坐标。;-)

\documentclass[tikz,border=3mm]{standalone}
\usepackage{dsfont}
\begin{document}
\begin{tikzpicture}[>=stealth]
 \path[left color=white,right color=green] plot[domain=-4:4,smooth]
 ({sign(\x)*pow(abs(\x),5/3)/2.5},\x) -| cycle;
 \draw (-4,-4) rectangle (4,4); 
 \draw[orange,ultra thick] plot[domain=-4:4,smooth]
     ({sign(\x)*pow(abs(\x),5/3)/2.5},\x);
 \draw[->] (-4,0) -- (4,0) node[right]{$\mathds{R}$};    
 \draw[->] (0,-4) -- (0,4) node[above]{$\mathds{R}$};    
 \draw[very thick,blue,->] (0,0) 
  node[circle,draw,fill,black,inner sep=2pt,label={[black,inner sep=1pt]above left:{$\bar x=(0,0)$}}]{} 
    -- (2,0) node[above]{$\mathcal{N}_S^P(x)=\emptyset$}
            node[below,black]{$\mathcal{N}_S^C(x)$};
 \path (2.2,2.020) % Groundhog day!
    node{$x_2^5=x_1^3$} (-3,2.5) node{$\mathcal{S}$};   
\end{tikzpicture}
\end{document}

在此处输入图片描述

附录:由于这是带标签的pgfplots,因此这里是使用 的版本pgfplots。它还使用clip和圆角,如Black Mild 的回答(+1)。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{dsfont}
\begin{document}
\begin{tikzpicture}[>=stealth]
 \begin{axis}[hide axis,width=9cm,height=9cm,domain=-1:1,clip mode=individual] 
  \begin{scope}
   \draw[rounded corners,clip] (-1,-1) rectangle  (1,1);
   \path[left color=white,right color=green] plot[domain=-1:1,smooth]
   ({pow(\x,5)},{pow(\x,3)}) -| cycle;
   \addplot[orange,ultra thick,smooth]  (x^5,x^3) ;
  \end{scope}
  \draw[very thick,blue,->] (0,0) 
   node[circle,draw,fill,black,inner sep=2pt,label={[black,inner sep=1pt]above left:{$\bar x=(0,0)$}}]{} 
     -- (0.5,0) node[above]{$\mathcal{N}_\mathcal{S}^P(x)=\emptyset$}
             node[below,black]{$\mathcal{N}_\mathcal{S}^C(x)$};
  \path (0.55,0.5) node{$x_2^5=x_1^3$} (-0.75,0.6) node{$\mathcal{S}$};
  \draw[->] (-1,0) -- (1,0) node[right]{$\mathds{R}$}; 
  \draw[->] (0,-1) -- (0,1) node[above]{$\mathds{R}$};  
 \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

我使用曲线的参数形式x1=t^5,x2=t^3,在圆角正方形内进行裁剪[-1,1]^2,并缩放整个图片。

在此处输入图片描述

\documentclass[tikz,border=5mm]{standalone}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}[scale=4]

\begin{scope}\clip[rounded corners] (-1,-1) rectangle (1,1);
\def\gr{plot[variable=\t,domain=-1:1] (\t^5,\t^3)}
\fill[left color=white,right color=green] \gr|-(-1,1)|-cycle;
\draw[orange,smooth,very thick] \gr;
\draw[rounded corners](-1,-1) rectangle (1,1);
\draw[-stealth,blue,very thick] (0,0)--(.5,0) 
node[above]{$\mathcal{N}^P_{\mathcal{S}} (\bar{x})=\emptyset$}
node[below,black]{$\mathcal{N}^C_{\mathcal{S}} (\bar{x})$};
\fill (0,0) circle(.8pt) node[above left]{$\bar{x}=(0,0)$};
\end{scope}

\draw[->] (-1,0)--(1,0) node[right]{$\mathbb{R}$}; 
\draw[->] (0,-1)--(0,1) node[above]{$\mathbb{R}$};
\path 
(.7,.5) node{$x_2^5=x_1^3$}
(-.7,.5) node{$\mathcal{S}$};
\end{tikzpicture}
\end{document}

答案3

为了好玩,pstricks解决方案:

\documentclass[svgnames, x11names,border=6pt]{standalone}%
\usepackage{amssymb} 
\usepackage{pst-grad, pst-plot, auto-pst-pdf}%

\begin{document}

 \psset{xunit=1.3, yunit=2, arrowinset=0.12, algebraic, plotstyle=curve, plotpoints=200, labelFontSize=\scriptstyle}%
\begin{pspicture}(-4.66, -2.53)(5,2.53)%
\psset{linecolor=IndianRed}%
\pscustom[linestyle=none, fillstyle=gradient, gradangle=240,gradbegin=MistyRose, gradend=White, gradmidpoint= 1]{\psline(-4.66,2.53)(-4.66,-2.53) \parametricplot{-1.36}{1.36}{t^5|t^3}\psline(4.66,2.53)(-4.66,2.53)}
\psaxes[linecolor=LightSteelBlue3, ticks=none, labels=none]{->}(0,0)(-4.66,-2.53)(5,2.53)[$x_1$, -120][$x_2$, -135]
\parametricplot[plotpoints=400, linewidth=1.5pt]{-1.36}{1.36}{t^5|t^3}
\psline[linewidth = 1.5pt, linecolor=Navy]{*->}(0,0)(1.5,0)
\uput[u](1.5,0){\color{RoyalBlue}$\mathcal{N}^{P}_{\mathcal{S}}(\bar {x}) = \varnothing$}
\uput[d](1.5,0){$\mathcal{N}^{C}_{\mathcal{S}}(\bar {x})$}
\uput[ul](0,0){$\bar{x}=(0,0)$}
\rput(-3.2,1.6){$\mathcal{S}$}
\rput{35}(2.6,1.6){$x_1^5 = x_2^3$}
\end{pspicture}

\end{document} 

在此处输入图片描述

相关内容