14
$\begingroup$

Bug introduced in 7.0 or earlier and persisting through 13.1


Show @ Graph[{1 -> 2, 2 -> 3}, Frame -> True]
Normal @ %

enter image description here

Is this a pure bug, or have I missed something?


InputForms reveal that Disks are converted correctly while Arrows remain in GraphicsComplex form. Going with investigation further, I found that not all Arrows...

{#, Normal @ #} & @ Graphics[
    GraphicsComplex[
      {{0, 0}, {1., 0}, {2., 0}}, 
      {
        {[email protected], Blue, Arrow[{{1, 2}, {2, 3}}, .03]},
        {[email protected], Red, Arrow[{1, 2}, .03], Arrow[{2, 3}, .03]}
    }], 
    ImageSize -> 300
]

enter image description here

So, as we can see, "separate" arrows are converted correctly while those gathered under one Arrow are not...

Q is there any quick fix to convert Graph to normal form correctly?

V10.3.1 Win 10

$\endgroup$
3
  • 2
    $\begingroup$ Normal[# /. a : Arrow[{__List}, _] :> Thread@a] gives a quick fix for these examples $\endgroup$ Commented Jan 29, 2016 at 18:35
  • $\begingroup$ Now answered ;-) $\endgroup$ Commented Jan 29, 2016 at 18:47
  • 4
    $\begingroup$ I don't see how this can be anything but a bug so I am adding the tag. $\endgroup$
    – Mr.Wizard
    Commented Jan 29, 2016 at 23:26

1 Answer 1

10
$\begingroup$
Normal[# /. a : Arrow[{__List}, Except[_List]] :> Thread @ a]

gives a quick fix for these examples.

$\endgroup$
2
  • 1
    $\begingroup$ I'd add Except[_List] for the second argument since it can be a list too. Or better map with it. $\endgroup$
    – Kuba
    Commented Jan 29, 2016 at 18:53
  • $\begingroup$ @Kuba, good point $\endgroup$ Commented Jan 29, 2016 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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