2
$\begingroup$

I want to make a graph of the mother nuclides of all Tin Isotopes. I found this

g = Graph[Union@Flatten[
 Thread[DirectedEdge @@ ##] & /@ 
  Select[{#, IsotopeData[#, "DaughterNuclides"]} & /@ 
    IsotopeData[], #[[2]] != {} &]]];

and that

g1 = Union[Flatten[VertexComponent[g, #] & /@ #], #] &@{Entity[
 "Isotope", "Tin112"], Entity["Isotope", "Tin114"], 
Entity["Isotope", "Tin115"], Entity["Isotope", "Tin116"], 
Entity["Isotope", "Tin117"], Entity["Isotope", "Tin118"], 
Entity["Isotope", "Tin119"], Entity["Isotope", "Tin120"], 
Entity["Isotope", "Tin122"], Entity["Isotope", "Tin124"]};

and a labelling function for vertices:

vf[{xc_, yc_}, name_, {w_, h_}] :=Block[{},{Black, 
Background -> 
 If[StringCases[IsotopeData[name, "StandardName"], 
    "Tin"] == {"Tin"}, LightRed, LightBlue], 
Inset[IsotopeData[name, "FullSymbol"], {xc, yc}]}];

Now I was able to make this:

g2 = Subgraph[g, g1, VertexShapeFunction -> vf, GraphLayout -> "LayeredDigraphEmbedding", PlotTheme -> "Monochrome", AspectRatio -> 2]

Now, how can I add DecayModeSymbols as a label for the graph edges? And best would be if I can switch them off individually where it gets too crowdy.

$\endgroup$
  • $\begingroup$ Have a look at EdgeLabels and EdgeShapeFunction. $\endgroup$ – Henrik Schumacher Jan 24 at 13:52
  • $\begingroup$ thanks, I already looked at those. But I was unable to create some kind of list with the properties from the existing graph. But as far as I understood such a list is needed for EdgeLabels or EdgeShapeFunction. $\endgroup$ – Stefan Jan 24 at 13:58

Your Answer

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

Browse other questions tagged or ask your own question.