改变森林方块的颜色

改变森林方块的颜色

我想更改其中一个块的颜色,但不确定该怎么做。这是我的流程图:

image

代码是..

\documentclass[12pt,twoside]{beamer}
\usepackage[spanish,es-noquoting]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{multimedia}
\usepackage{forest}
\setbeamertemplate{frametitle}[default][center]
\setbeamersize{text margin left=2em,text margin right=2em}
\begin{document}

\begin{frame}[shrink=25]{Results}

\begin{forest}
  for tree={
    rounded corners, draw, align=center, top color=white, bottom color=blue!20,
    edge+=->,
    l sep'+=10pt,
  }, 
   [This
     [is the forest
       [chart I want ]%want this block green if is possible.. :)
       [but it is not]
     ]
     [working
       [help!]
     ]
   ] 
\end{forest}
\end{frame}
\end{document}

如何使“我想要的图表”变成绿色(顶部也是白色)?

答案1

您可以通过在括号内写逗号和选项来为特定节点添加额外选项,例如[foo, draw=red,fill=blue],所以我想您想要[chart I want, bottom color=green!20]

output of code

\documentclass[12pt,twoside]{beamer}
\usepackage[spanish,es-noquoting]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{multimedia}
\usepackage{forest}
\setbeamertemplate{frametitle}[default][center]
\setbeamersize{text margin left=2em,text margin right=2em}
\begin{document}

\begin{frame}[shrink=25]{Results}

\begin{forest}
  for tree={
    rounded corners, draw, align=center, top color=white, bottom color=blue!20,
    edge+=->,
    l sep'+=10pt,
  }, 
   [This
     [is the forest
       [chart I want, bottom color=green!20]
       [but it is not]
     ]
     [working
       [help!]
     ]
   ] 
\end{forest}
\end{frame}
\end{document}

相关内容