考虑以下代码
\documentclass{beamer}
\usetheme{Madrid}
\usecolortheme{beaver}
\setbeamercolor{section in head/foot}{bg=gray!10!white, fg=gray!10!white}
\setbeamercolor{palette quaternary}{bg=darkred}
\usepackage[utf8x]{inputenc}
\usepackage{smartdiagram}
\usepackage{pst-coil,pst-slpe}
\setbeamertemplate{headline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette
quaternary}%
\insertsectionnavigationhorizontal{\paperwidth}{}{}
\end{beamercolorbox}%
}
}
\begin{document}
\begin{frame}{Problématique}
\begin{center}
\psscalebox{0.7 0.7} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-5.4)(17.86,4.4)
\pscircle[linestyle=none,fillstyle=solid,fillcolor=red!30](8.4,-
0.2){1.8}
\rput[bl](7.4,0.2){\textbf{Problèmes}}
\rput[bl](6.8,-0.6){\textbf{d'ordonnancement}}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=cyan!30](5.6,3.4){1.2}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=blue!30](11.6,4.2){1.2}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=green!30](14.0,0.2){1.2}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=orange!30](1.6,-1.4){1.4}
\rput[bl](4.7,3.8){Contraintes}
\rput[bl](5.4,3.3){de}
\rput[bl](4.8,2.7){précédence}
\rput[bl](13.1,0.5){Contraintes }
\rput[bl](13.7,0){de}
\rput[bl](13.4,-0.6){blocage}
\rput[bl](1,-0.9){Temps}
\rput[bl](0.4,-1.5){d'attente entre}
\rput[bl](0.5,-2.2){les opérations}
\rput[bl](10.7,4.4){Contraintes}
\rput[bl](11.3,3.9){de}
\rput[bl](11.05,3.4){conflit}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=teal!30](16.4,-3.0){0.8}
\rput[bl](15.9,-3.0){Maite-}
\rput[bl](15.9,-3.4){nance}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=magenta!30](0.8,3.8){0.8}
\rput[bl](0.2,3.7){no-wait}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=brown!30](11.6,-3.8){1.2}
\rput[bl](10.7,-3.4){Contraintes}
\rput[bl](11.4,-4){de}
\rput[bl](10.8,-4.5){ressources}
\pscircle[linestyle=none,fillstyle=solid,fillcolor=violet!30](5,-4.1){1.35}
\rput[bl](4.3,-3.4){Période}
\rput[bl](3.8,-4.2){d'indisponibilté}
\rput[bl](3.95,-4.8){des machines}
\end{pspicture}
}
\end{center}
\end{frame}
\end{document}
输出为
我想:
- 使节点中的颜色和文字看起来像智能图(星座图)中一样美观
- 像在智能图(星座图)中一样从节点绘制到中心节点的箭头,而不改变节点的位置。
答案1
我想你想要这样的东西。我简化了你的代码加载pst-node
和使用\Cnodeput
命令。除了 pst-nodestackengine
和之外,此代码还需要加载pgffor
。它可能会被进一步简化(并且更容易理解)用于polar coordinates
放置节点。
\documentclass[svgnames]{beamer}
\usetheme{Madrid}
\usecolortheme{beaver}
\setbeamercolor{section in head/foot}{bg=gray!10!white, fg=gray!10!white}
\setbeamercolor{palette quaternary}{bg=darkred}
\usepackage[utf8x]{inputenc}
\usepackage{smartdiagram}
\usepackage{pst-coil,pst-slpe}%, auto-pst-pdf
\setbeamertemplate{headline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette
quaternary}%
\insertsectionnavigationhorizontal{\paperwidth}{}{}
\end{beamercolorbox}%
}
}
\usepackage[usestackEOL]{stackengine}
\usepackage{pgffor}
\begin{document}
\begin{frame}{Problématique}
\begin{center}
\psscalebox{0.7 0.7} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-5.4)(17.86,4.4)
\psset{fillstyle=solid, linestyle=none}
\Cnodeput[radius=1.8, fillcolor=red!30](8.4,-0.2){PO}{\bfseries\Centerstack{Problèmes\\d'ordonnancement}}
\Cnodeput[radius=1.55, fillcolor=orange!30](1.6,-1.4){TA}{\Centerstack{Temps d’attente\\entre\\les opérations}}
\Cnodeput[radius=1.4, fillcolor=violet!30](5,-4.1){PI}{\Centerstack{Période\\d'indisponibilité\\des machines}}
\psset{radius=1.2}
\Cnodeput[fillcolor=cyan!30](5.6,3.4){CP}{\Centerstack{Contraintes\\de\\précedence}}
\Cnodeput[fillcolor=blue!30](11.6,4.2){CC}{\Centerstack{Contraintes\\de conflit}}
\Cnodeput[fillcolor=brown!30](11.6,-3.8){CR}{\Centerstack{Contraintes\\de ressources}}
\Cnodeput[fillcolor=green!30](14.0,0.2){CB}{\Centerstack{Contraintes\\de blocage}}%
\psset{radius=0.8}
\Cnodeput[fillcolor=teal!30](16.4,-3.0){MN}{\Centerstack{Mainte\\nance}}
\Cnodeput[fillcolor=magenta!30](0.8,3.8){NW}{no-wait}
\psset{arrows=->, arrowinset=0, arrowlength=0.8, linestyle=solid, linewidth=3mm, linecolor=Lavender!60, nodesep=3pt}
\foreach \mynode in {TA,PI,CP,CC,CR,CB,MN,NW}{\ncline{\mynode}{PO}}
\end{pspicture}
}
\end{center}
\end{frame}
\end{document}
答案2
这只是我的个人意见,但我会选择tikz
而不是pspicture
,因为这也是smartdiagram
您在另一张幻灯片中使用的。为您提供一些入门知识:
\documentclass{beamer}
\usetheme{Madrid}
\usecolortheme{beaver}
\usepackage{tikz}
\usepackage{smartdiagram}
\begin{document}
\begin{frame}{Problématique}
\begin{tikzpicture}[font=\tiny,fill,circle,minimum size=0.7cm,inner sep=5pt, align=center]
\node[fill=red!20, text width=2cm] at (4,0) (A) {Problèmes d'ordonnancement};
\node[fill=cyan!20] at (1,1) (B) {Contraintes};
\draw [->] (B) -- (A);
\end{tikzpicture}
\end{frame}
\begin{frame}{test}
\smartdiagramset{
planet text width=2.5cm,
satellite font=\scriptsize,
bubble text opacity = 1,
uniform connection color =true,
connection color = bg
}
\begin{center}
\scalebox{0.8}{
\usebeamercolor{background canvas}
\smartdiagram[constellation diagram]{
Conditions de simulation,
Type de tâches,
Contraintes temporelles,
Test de faisabilité du GEDF,
Contraintes systèmes,
Contraintes énergétiques
}
}
\end{center}
\end{frame}
\end{document}