将文本放在 tikz 图片椭圆的底部

将文本放在 tikz 图片椭圆的底部

我有以下代码:

\documentclass[journal]{IEEEtran}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}

\begin{figure}[ht]
\begin{tikzpicture}
\node[rounded corners, draw, fill=gray!20 ,text height = 5cm,minimum     width=9cm] (main){All Feasible Schedules};
\node[ellipse, draw, fill=red!20, text height =3cm, minimum width = 8cm] at (main.center)  (semi) {Semi-Active Schedules};
\node[ellipse, draw,fill=red!35, text height = 1.5cm, minimum width = 5cm] at (main.center) (active) {Active Schedules};
\node[ellipse, draw, fill=red!42,align=left, anchor=east, xshift=-0.5cm ] at (active.east) (non) {Non-delay\\Schedules};

\end{tikzpicture}
\end{figure}

这使:

在此处输入图片描述

我怎样才能让文本semi-active schedulesactive schedules紧密地嵌套在各自的椭圆的底部?

答案1

使用labels 和abovekey:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}

\begin{document}
\begin{tikzpicture}
\node[rounded corners, draw, fill=gray!20 ,text height = 5.5cm,minimum     width=9cm] (main){All Feasible Schedules};
\node[ellipse, draw, fill=red!20, text height =3cm, minimum width = 8cm,label={[anchor=south,above=6.5mm]270:Semi-Active Schedules}] at (main.center)  (semi) {};
\node[ellipse, draw,fill=red!35, text height = 1.5cm, minimum width = 5cm,label={[anchor=south,above=6mm]270:Active Schedules}] at (main.center) (active) {};
\node[ellipse, draw, fill=red!42,align=left, anchor=east, xshift=-0.5cm ] at (active.east) (non) {Non-delay\\Schedules};

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容