2
$\begingroup$

I am trying to plot a graph using LayeredGraphPlot;

I would like to change the style of the edges commented out inside the following command to dashed lines with different colors:

chart = LayeredGraphPlot[{{"S" -> "E", ""}, {"E" -> "I", 
    " \!\(\*SubscriptBox[\(e\), \(i\)]\) "}, {"I" -> "H", 
    " \!\(\*SubscriptBox[\(i\), \(h\)]\) "}, {"E" -> "R", 
    " \!\(\*SubscriptBox[\(e\), \(r\)]\)"}, {"I" -> "R", 
    " \!\(\*SubscriptBox[\(i\), \(r\)]\)"}, {"H" -> "R", 
    " \!\(\*SubscriptBox[\(h\), \(r\)]\)  "}, {"H" -> "D", 
    " \!\(\*SubscriptBox[\(h\), \(\(d\)\(\\\ \\\ \\\ \)\)]\)"(*{"E"\
\[Rule]"S", "  Subscript[\[Beta], e]  "},{"I"\[Rule]"S", 
   "  Subscript[\[Beta], i]  "}*)}}, Left, 
  VertexShapeFunction -> ({EdgeForm[Black], Yellow, Disk[#1, 0.2], 
      Black, Text[#2, #1]} &), PlotStyle -> {Blue}, 
  VertexSize -> Large, 
  EdgeLabelStyle -> Directive[10, Background -> White]]

Thank you!

$\endgroup$
2
  • 3
    $\begingroup$ Wrap the edge in Style, like Style["E" -> "S", Dashed, Green, Thick] or similar. $\endgroup$
    – Jason B.
    May 24, 2021 at 12:21
  • $\begingroup$ Dear Jason, Thank you so much for your help! It worked :) $\endgroup$ May 24, 2021 at 12:48

0

Browse other questions tagged or ask your own question.