Guest User

Untitled

a guest
Jan 24th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. g = Graph[Union@Flatten[
  2. Thread[DirectedEdge @@ ##] & /@
  3. Select[{#, IsotopeData[#, "DaughterNuclides"]} & /@
  4. IsotopeData[], #[[2]] != {} &]]];
  5.  
  6. g1 = Union[Flatten[VertexComponent[g, #] & /@ #], #] &@{Entity[
  7. "Isotope", "Tin112"], Entity["Isotope", "Tin114"],
  8. Entity["Isotope", "Tin115"], Entity["Isotope", "Tin116"],
  9. Entity["Isotope", "Tin117"], Entity["Isotope", "Tin118"],
  10. Entity["Isotope", "Tin119"], Entity["Isotope", "Tin120"],
  11. Entity["Isotope", "Tin122"], Entity["Isotope", "Tin124"]};
  12.  
  13. vf[{xc_, yc_}, name_, {w_, h_}] :=Block[{},{Black,
  14. Background ->
  15. If[StringCases[IsotopeData[name, "StandardName"],
  16. "Tin"] == {"Tin"}, LightRed, LightBlue],
  17. Inset[IsotopeData[name, "FullSymbol"], {xc, yc}]}];
  18.  
  19. g2 = Subgraph[g, g1, VertexShapeFunction -> vf, GraphLayout -> "LayeredDigraphEmbedding", PlotTheme -> "Monochrome", AspectRatio -> 2]
Add Comment
Please, Sign In to add comment