为图表中的圆圈着色

为图表中的圆圈着色

我想画一个白色、黑色边界的圆圈。我该怎么做?这是我的代码:

    \documentclass{article}
    \usepackage{multicol,multirow}
    \setcounter{secnumdepth}{4}
    \setcounter{tocdepth}{4}
    \usepackage{color}
    \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
    \usepackage{pgf}
    \usepackage{pgfplots}
    \usepackage{tikz}
    \usetikzlibrary{arrows,automata}
    \usepackage{pstricks,pst-plot}
    \usepackage{amsmath,amsfonts,amsthm,amscd}
    \usepackage[all]{xy}
    \usepackage{breqn}
    \usepackage{shapepar}
    \usepackage{hyperref}
    \usepackage{paralist}
    \usepackage{rotating}
    \usepackage{longtable}
    \usepackage{graphicx}
    \usepackage{subfigure}
    \usepackage{caption}
    \usepackage{bidipoem}
    \usetikzlibrary{mindmap}
    \usetikzlibrary[mindmap]
    \usepackage{makeidx}
    \makeindex
    \newcommand{\latex}{\LaTeX\ }
    \newtheorem{thm}{Theorem}
    \newtheorem{Def}{Definition}
    \newtheorem{exmp}{Example}
    \newcommand*{\titr}[2]{{\LARGE \bf #1}{\large \bf #2}}
    \begin{document}
    \begin{figure}[h]
        \begin{center}
            \begin{tikzpicture}
                \path[mindmap,concept color=black,text=white,minimum size=4.5cm]
                node[concept] {\Large\textsc{Happy}\\[0.1cm]\titr{N}{OW}\titr{R}{UZ}\\[0.3cm]\huge1396}
                child [grow=35,concept color=red,minimum size=3cm] {node[concept]{\large\textbf{\textit{Mental $\&$\\[0cm] Physical\\[0.1cm] Health}}}}
                child [grow=-25,concept color=blue!90,minimum size=2.5cm] {node[concept]{\large\textbf{\textit{Global\\[0.1cm]Peace}}}}
                child [grow=-90,concept color=orange,minimum size=2cm] {node[concept]{\large\textbf{\textit{Too \\[0.1cm]Much \\[0.2cm]Wealth}}}}
                child [grow=-150,concept color=yellow,text=black,minimum size=2.5cm] {node[concept]{\large\textbf{\textit{Full of\\[0.1cm]Happiness}}}}
                child [grow=155,concept color=RubineRed,minimum size=2cm] {node[concept]{\large\textbf{\textit{LOVE}}}}
                child [grow=100,concept color=white,minimum size=2cm,text=black] {node[concept]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}};
            \end{tikzpicture}
        \end{center}
    \end{figure}
    \centering \Large
    \sc Sincerely yours,\\
    \sc Ehsan Benabbas
    \end{document}

答案1

添加draw=black到相应概念节点的选项中:

node[concept,draw=black]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}

在此处输入图片描述

\documentclass[border=2pt]{standalone}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\newcommand*{\titr}[2]{{\LARGE \bfseries #1}{\large \bfseries #2}}
\begin{document}
\begin{tikzpicture}
  \path[mindmap,concept color=black,text=white,minimum size=4.5cm]
    node[concept] {\Large\textsc{Happy}\\[0.1cm]\titr{N}{OW}\titr{R}{UZ}\\[0.3cm]\huge1396}
      child [grow=35,concept color=red,minimum size=3cm] {node[concept]{\large\textbf{\textit{Mental $\&$\\[0cm] Physical\\[0.1cm] Health}}}}
      child [grow=-25,concept color=blue!90,minimum size=2.5cm] {node[concept]{\large\textbf{\textit{Global\\[0.1cm]Peace}}}}
      child [grow=-90,concept color=orange,minimum size=2cm] {node[concept]{\large\textbf{\textit{Too \\[0.1cm]Much \\[0.2cm]Wealth}}}}
      child [grow=-150,concept color=yellow,text=black,minimum size=2.5cm] {node[concept]{\large\textbf{\textit{Full of\\[0.1cm]Happiness}}}}
      child [grow=155,concept color=RubineRed,minimum size=2cm] {node[concept]{\large\textbf{\textit{LOVE}}}}
      child [grow=100,concept color=white,minimum size=2cm,text=black] {node[concept,draw=black]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}};
  \end{tikzpicture}
\end{document}

答案2

绘制概念节点两次,第一次使用粗黑色边框,第二次按现在的样子绘制。第一个节点将完全被覆盖,只留下黑色边框。

node[concept,draw=black,line width=3pt]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}
node[concept]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}

重复内容的目的是让第一个覆盖节点的大小与第二个节点完全相同。对线宽(此处为 3pt)进行一些实验,直到看起来合适为止。

在此处输入图片描述

\documentclass[border=2pt]{standalone}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\newcommand*{\titr}[2]{{\LARGE \bfseries #1}{\large \bfseries #2}}
\begin{document}
\begin{tikzpicture}
  \path[mindmap,concept color=black,text=white,minimum size=4.5cm]
    node[concept] {\Large\textsc{Happy}\\[0.1cm]\titr{N}{OW}\titr{R}{UZ}\\[0.3cm]\huge1396}
      child [grow=35,concept color=red,minimum size=3cm] {node[concept]{\large\textbf{\textit{Mental $\&$\\[0cm] Physical\\[0.1cm] Health}}}}
      child [grow=-25,concept color=blue!90,minimum size=2.5cm] {node[concept]{\large\textbf{\textit{Global\\[0.1cm]Peace}}}}
      child [grow=-90,concept color=orange,minimum size=2cm] {node[concept]{\large\textbf{\textit{Too \\[0.1cm]Much \\[0.2cm]Wealth}}}}
      child [grow=-150,concept color=yellow,text=black,minimum size=2.5cm] {node[concept]{\large\textbf{\textit{Full of\\[0.1cm]Happiness}}}}
      child [grow=155,concept color=RubineRed,minimum size=2cm] {node[concept]{\large\textbf{\textit{LOVE}}}}
      child [grow=100,concept color=white,minimum size=2cm,text=black] {node[concept,draw=black,line width=3pt]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}
   node[concept]{\large\textbf{\textit{Warmest\\[0.1cm] Wishes}}}};
  \end{tikzpicture}
\end{document}

相关内容