绘制不等式区域

绘制不等式区域

如何在 LaTeX 中的一个图中绘制这些不等式的区域:

问题

它看起来应该是这样的

例子

答案1

% arara: pdflatex

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\usepgfplotslibrary{fillbetween}
\usepackage{mathtools}
\usepackage{amsfonts}

\begin{document}
\begin{align*}
    &A=\{(x,y)\in\mathbb{R}^2 \mid x\geq 0, y\geq 0, x^4+y^4<1\}\\
    &B=\{(x,y)\in\mathbb{R}^2 \mid x\leq 0, y\leq 0, x^4+y^4<1\}
\end{align*}

\[  
\begin{tikzpicture}
\begin{axis}[%
    ,axis lines=middle
    ,xmin=-2.2,xmax=2.2
    ,ymin=-2.2,ymax=2.2
    ]
\addplot[name path=a, domain=0:1, samples=41] {(1-x^4)^0.25} \closedcycle node at (current path bounding box.center) {A};
\path[name path=axisr] (axis cs:0,0) -- (axis cs:1,0);
\addplot[gray!30] fill between[of=a and axisr];
\addplot[name path=b, domain=-1:0, samples=41] {-(1-x^4)^0.25} \closedcycle node at (current path bounding box.center) {B};
\path[name path=axisl] (axis cs:-1,0) -- (axis cs:0,0);
\addplot[gray!30] fill between[of=b and axisl];
\end{axis}
\end{tikzpicture}
\]
\end{document}

在此处输入图片描述

相关内容