![將文字放在 tikz 圖片中橢圓的底部](https://rvso.com/image/309864/%E5%B0%87%E6%96%87%E5%AD%97%E6%94%BE%E5%9C%A8%20tikz%20%E5%9C%96%E7%89%87%E4%B8%AD%E6%A9%A2%E5%9C%93%E7%9A%84%E5%BA%95%E9%83%A8.png)
我有以下程式碼:
\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 schedules
, 並active schedules
緊貼在各自橢圓的底部?
答案1
使用label
s 和above
key:
\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}