# Arrow direction and shape color in smart diagram

I want to make following diagram-

Below is my code of smartdiagram-

\begin{figure}
\centering
\smartdiagramset{back arrow disabled=true,
module minimum width=2cm,
module minimum height=2cm,
module x sep=3cm,
text width=2cm,
}
}
Reward Function (R), Inverse Reinforcement Learning, Optimal Policy ($\pi$)
}{below of module1/R that explains expert trajectories,above of module2/Environment Model (MDP), below of module3/Expert trajectories}
\end{figure}


This is the generated diagram-

I want to changes following things in this diagram-

1. The direction of arrow (From right to left and from top to bottom)
2. The look and feel of additional modules similar to other
3. The arrow corresponding to additional modules similar to other
• Please always post compilable code as this makes it much easier to help and much more likely that a solution will help. You need at least a class, a document environment and the package for drawing the diagrams.
– cfr
May 15 '16 at 20:05

Changing arrow style from the default <- to -> ensures that the arrows go in the correct direction for the main nodes:

For a uniform look to the arrows remove

additional arrow tip=stealth,


[I'm not sure if you want this or not.]

To support the arrows going in the different directions for the additional modules, you need to leave the automatic connections disabled and add them afterwards by hand.

\smartdiagramconnect{<-}{module2/additional-module2}


To change the look of the additional modules, you can adapt their style using the keys described in the manual.

  additions={
}


Complete code:

\documentclass{article}
\usepackage{smartdiagram}
\begin{document}
\smartdiagramset{%
back arrow disabled=true,
module minimum width=2cm,
module minimum height=2cm,
module x sep=3cm,
text width=2cm,
arrow style=->,
}
}
Reward Function (R), Inverse Reinforcement Learning, Optimal Policy ($\pi$)
}{below of module1/R that explains expert trajectories,above of module2/Environment Model (MDP), below of module3/Expert trajectories}
\end{document}


I never use smartdiagram so I suggest a solution which instead use the pure TikZ picture:

\documentclass[border=3mm,
tikz]{standalone}

\begin{document}
\begin{tikzpicture}[
node distance = 7mm and 9mm,
MN/.style args = {#1/#2}{
draw=#1,% line color
top color=#2!10,
bottom color=#2!80,
rounded corners, thick,
text width=27mm, minimum height=13mm, inner sep=1mm,
align=flush center},
line/.style = {line width=2mm,
draw=#1,%line color
-{Triangle[length=2.8mm,width=4mm,fill=#1]},
shorten >=1mm, shorten <=1mm
},
]
%---
% bottom
\node (n1) [MN=red/white]                   {R that explains expert trajectories};
% middle
\node (n2) [MN=gray/red, ds,above=of n1]    {Reward Function (R)};
\node (n3) [MN=gray/cyan,ds,right=of n2]    {Inverse Reinforcement Learning};
\node (n4) [MN=gray/blue,ds,right=of n3]    {Optimal Policy ($\pi$)};
% bottom
\node (n5) [MN=red/white,below=of n4]       {Expert trajectories (R)};
% top
\node (n6) [MN=red/white,above=of n3]       {Environment Model (MDP)};
% lines
\draw[line=red]     (n6) edge (n3)
(n1) edge (n2)  (n5) to (n4);
\draw[line=cyan]    (n2) edge (n3);
\draw[line=blue]    (n3) edge (n4);
\end{tikzpicture}
\end{document}

• I am big fan of tikz, I always prefer it. But recently I saw smartdiagram, and I thought of using it. I think tikz is the best option always. Thank you very much. May 17 '16 at 3:57