我们可以画一个这样的图表吗?

我们可以画一个这样的图表吗?

我们可以画一个这样的图吗?

在此处输入图片描述

答案1

像这样:

在此处输入图片描述

代码(根据需要更改颜色和尺寸):

\documentclass[a4paper]{article}
\usepackage{lmodern}
%\usepackage[T1]{fontenc}
\usepackage{tikz}
%\usetikzlibrary{calc,intersections}


\begin{document}
    
    \begin{center}
        \begin{tikzpicture}[font=\sffamily\small]
            %
            %\draw[gray!20,step=0.5cm] (-6.5,-1) grid (6.5,6.5);
            %
            \draw[->,thick] (-6.6,0) -- (6.6,0) node[anchor=west]{$x$};
            \draw[->,thick] (0,-1) -- (0,6.6) node[anchor=south]{$y$};
            %
            \foreach \x in {-6,-5,...,6} \draw [thick](\x cm,-2pt) -- (\x cm,2pt);
            \foreach \y in {-1,0,...,6} \draw [thick](-2pt,\y) -- (2pt,\y);
            %
            \foreach \x in {-6,-5,...,6} \draw (\x cm, 0 cm) node[anchor=north]{\x};
            \foreach \y in {-1,0,...,6}  \draw (0 cm, \y cm) node[anchor=east]{\y};
            %
            \clip (-6.2,0) rectangle (6.2,6.5);
            \filldraw[orange!20,draw=red,line width=2pt,opacity=.5] (0,0) ellipse (6 and 4.5);
            \filldraw[cyan!20,draw=cyan,line width=2pt,opacity=.5] (0,0) ellipse (4.5 and 3);
            \filldraw[green!20,draw=green,line width=2pt,opacity=.5] (0,0) ellipse (3.5 and 2);
            \filldraw[red!20,draw=red,line width=2pt,opacity=.5] (0,0) ellipse (2.5 and 1.2);
            \filldraw[yellow!20,draw=yellow,line width=2pt,opacity=.5] (0,0) ellipse (1.5 and .6);
        \end{tikzpicture}
    \end{center}
\end{document}

相关内容