tikz 可以畫這張圖嗎?

tikz 可以畫這張圖嗎?

在此輸入影像描述

問題:請推薦一些線上工具來繪製此圖像。可以用tikz畫這個圖嗎?如果是的話怎麼辦?

我的程式碼:

\usepackage{tikz}
\begin{document}
\draw (2,2) ellipse (3cm and 1cm);
\draw (2,6) ellipse (3cm and 1cm);

\draw (2,8) ellipse (3cm and 1cm);
\draw (2,10) ellipse (3cm and 1cm);
\end{document}

答案1

在閱讀@Zarko 的答案後,我添加到outer sep了“整個”節點。

\documentclass[border=1mm,tikz]{standalone}
\usetikzlibrary{shapes,positioning}
\usetikzlibrary{backgrounds}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}

\begin{document}
\tikzset{set/.style={thick, draw,ellipse, minimum width=100pt,minimum
height=0.8cm,inner sep=0pt,    align=center}}
\begin{tikzpicture}
\node[set,double,double distance=5pt,postaction={draw},inner sep=2.5pt,
outer sep=2pt] (whole)
 {Whole group $\{1,-1,i,-i,-j,-j,k,-k\}$};
\node[set,below=1.2cm of whole] (normalj) {$\{1,-1,j,-j\}$};
\node[set,left=0.6cm of normalj] (normali) {$\{1,-1,i,-i\}$};
\node[set,right=0.6cm of normalj] (normalk) {$\{1,-1,k,-k\}$};
\node[set,double,double distance=2pt,inner sep=1pt,below=1.2cm of normalj]
(center) {$\{1,-1\}$, characteristic, center,
commutator subgroup};
\node[set,below=1.2cm of center,double,double distance=5pt,postaction={draw},inner sep=2.5pt] 
(trivial){Trivial subgroup};
\begin{pgfonlayer}{background}
\draw[ultra thick,latex-] (whole.south west) -- (normali);
\draw[ultra thick,latex-] (whole) -- (normalj);
\draw[ultra thick,latex-] (whole.south east) -- (normalk);
\draw[ultra thick,-latex] (center.north west) -- (normali);
\draw[ultra thick,-latex] (center.north) -- (normalj);
\draw[ultra thick,-latex] (center.north east) -- (normalk);
\draw[ultra thick,latex-] (center.south) -- (trivial.north);
\end{pgfonlayer}
\end{tikzpicture}
\end{document}

在此輸入影像描述

答案2

當OP加上tikz-trees標籤時,他可能會要求一個樹解決方案:

\documentclass[border=5mm,tikz]{standalone}
\usetikzlibrary{shapes,trees}

\begin{document}

\begin{tikzpicture}[grow=up,sibling distance=60mm,-latex,shorten >=1mm,
 every node/.style={draw, ellipse}, 
 triple/.append style={double,double distance=1.8pt,postaction={draw}}]

\node[triple] at (2,2) {Trivia subgroup $\{1\}$}
 child { node[double] {$\{1,-1\}$, characteristic, center, commutator subgroup} 
  child { node (nk) {$\{1,k,-1,-k\}$, normal} }
  child { node {$\{1,j,-1,-j\}$, normal} 
   child { node[triple] (w) {Whole group $\{1,-1,i,-i,j,-j,k,-k\}$} } }
  child { node (ni) {$\{1,i,-1,-i\}$, normal} } };

\draw[shorten >=2.5mm] (ni) -- (w);
\draw[shorten >=2.5mm] (nk) -- (w);

\end{tikzpicture}

\end{document}

在此輸入影像描述

答案3

作為練習和證明土撥鼠我不冬眠:-)

在此輸入影像描述

基於土撥鼠的回答一些小的變化,目標是圖像程式碼稍微短一些,更簡潔:

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows.meta, shapes, positioning}

\begin{document}
    \begin{tikzpicture}[
node distance = 12mm and 6mm,
   set/.style = {ellipse, draw, thick,
                 minimum size=12 mm,
                 inner xsep=#1, outer sep=1pt},
   set/.default = -1ex,
  dset/.style = {set=#1, double, double distance=4pt},
                        ]
\node[dset, postaction={draw}]  (whole)     {Whole group $\{1,-1,i,-i,-j,-j,k,-k\}$};
\node[set,below=of whole]       (normalj)   {$\{1,-1,j,-j\}$};
\node[set, left=of normalj]     (normali)   {$\{1,-1,i,-i\}$};
\node[set,right=of normalj]     (normalk)   {$\{1,-1,k,-k\}$};
\node[dset=-4ex,below=of normalj]  (center) {$\{1,-1\}$,
                                              characteristic, center,
                                              commutator subgroup};
\node[dset, postaction={draw},
      below=of center]          (trivial)   {Trivial subgroup};
    \begin{scope}[shorten <=3pt, shorten >=3pt, ultra thick, -Latex]
\draw   (normalj) edge (whole)
        (normali) edge (whole)
        (normalk) edge (whole)
        (center)  edge (normali)
        (center)  edge (normalj)
        (center)  edge (normalk)
        (trivial)   to  (center);
    \end{scope}
\end{tikzpicture}
\end{document}

答案4

為了好玩,使用橢圓形節點的環境解決方案psmatrix

\documentclass[border=3pt]{standalone}
\usepackage{mathtools, adjustbox}
\DeclarePairedDelimiter{\set}\{\}
\usepackage{pst-node, auto-pst-pdf} %% to compile with pMiKTeX) or pdflatex --shell-escape (TeX Live, MacTeX)

\begin{document}

\def\psrowhookiii{\psset{doubleline = true}}
\def\pscolhookii{\hskip -2.5cm}\def\pscolhookiii{\hskip -2.5cm}
\begin{psmatrix}[mnode = oval, rowsep = 1cm]
%%% Matrix nodes
& [name = W] \adjustbox{padding = -2.91em -1.92ex -2.91em -1.92ex}{\psovalbox[doubleline]{\adjustbox{padding = -2.2em 1.5ex -2.2em 1.5ex}{Whole group $\set[\big]{1,-1,i, -i, j, -j, k, -k}$}}} \\
[name = I] \adjustbox{padding = -0.6em 0.8ex -0.6em 0.8ex}{$ \set[big]{1,-1,i, -i} $} & [name = J] \adjustbox{padding = -0.6em 0.8ex -0.6em 0.8ex}{$ \set[big]{1,-1,j, -j} $} & [name = K] $ \adjustbox{padding = -0.6em 0.8ex -0.6em 0.8ex}{\set[big]{1,-1,k, k} $} \\
& [name = C] \makebox[3.8cm]{\set[\big]{-1,1} \begin{tabular}{l}characteristic, center, \\commutator subgroup\end{tabular}} \\
& [name = T] \adjustbox{padding = -1.38em -1.75ex -1.38em -1.75ex}{\psovalbox[doubleline]{\adjustbox{padding = -1em 1.5ex -1em 1.5ex}{Trivial subgroup}}}
%%% Connections
\foreach \start/\target in {T/C, C/I, C/J, C/K , I/W, J/W, K/W}{\ncline[arrows = ->, arrowinset = 0.12]{\start}{\target}}
\end{psmatrix}

\end{document} 

在此輸入影像描述

相關內容