2

Consider the follwoing code

\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}

The output is

enter image description here

I want:

  1. to make the colors and the words in the nodes look nice like in the smartdiagram (constellation diagram)
  2. to draw arrows from the nodes to the central node just like in the smartdiagram (constellation diagram) without changing the positions of the nodes.
  • You MWE does not compile for me. – samcarter_is_at_topanswers.xyz Feb 21 '17 at 15:51
  • First you ask a question how to remove the arrows and now you want them back? I am confused. – samcarter_is_at_topanswers.xyz Feb 21 '17 at 15:52
  • This is another example in which I need the arrows, and this case is different from the first one since the distances between the centrale node and the other nodes are not the same. – Farah Mind Feb 21 '17 at 15:55
  • I think with the smartdiagram we cannot have different distances from the central node, if it is possible, then it is not necessary to correct the above code. – Farah Mind Feb 21 '17 at 15:57
  • Does the above MWE compile for you? – samcarter_is_at_topanswers.xyz Feb 21 '17 at 16:00
2

I suppose you want something like this. I simplified your code loading pst-node and using the \Cnodeput command. This code requires loading, in addition to pst-node, stackengine and pgffor. It might be simplified further (and easier to understand) using polar coordinates for the placement of the nodes.

\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} 

enter image description here

| improve this answer | |
1

Just my personal opinion, but I would go with tikz instead of pspicture, as this is also what the smartdiagram from you other slide is using. To give you something to start with:

\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}

enter image description here

| improve this answer | |
  • Thank you. Is it possible to customize the constellation diagram of smartdiagram,to have nodes with different distances from the central node? – Farah Mind Feb 21 '17 at 16:25
  • @FarahMind No idea. But I'd like to quote cfr: tex.stackexchange.com/questions/354915/… – samcarter_is_at_topanswers.xyz Feb 21 '17 at 16:28
  • I am trying to use your code to get the diagram I want. I have problem in the positions of the node (I am not familiar with tikz) , when I add another node C, the positions of A and B change. I cannot find any solution in the net!!! – Farah Mind Feb 21 '17 at 20:16
  • @FarahMind The image is left aligned. So if you add node C left from the previous ones, they are moved to the right as the picture now becomes wider. Alternatively you can sue absolute positioning, search for something like [remember picture, overlay] – samcarter_is_at_topanswers.xyz Feb 21 '17 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.