Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm trying to change the text and arrow style in GraphPlot using the drawing tool, but the the vertex labels disappear when I do that:

GraphPlot[{Subscript[δ, 1] -> Subscript[X, 1], 
  Subscript[δ, 2] -> Subscript[X, 2], 
  Subscript[δ, 3] -> Subscript[X, 3], 
  Subscript[δ, 4] -> Subscript[X, 4], 
  Subscript[ξ, 1] -> 
   Subscript[ξ, 2], {Subscript[ξ, 2] -> Subscript[ξ, 1], 
   "\!\(\*SubscriptBox[\(ϕ\), \(21\)]\)"}, {Subscript[ξ, 
     1] -> Subscript[X, 1], 
   "\!\(\*SubscriptBox[\(γ\), \(11\)]\)"}, {Subscript[ξ, 
     1] -> Subscript[X, 2], 
   "\!\(\*SubscriptBox[\(γ\), \(21\)]\)"}, {Subscript[ξ, 
     2] -> Subscript[X, 3], 
   "\!\(\*SubscriptBox[\(γ\), \(32\)]\)"}, {Subscript[ξ, 
     2] -> Subscript[X, 4], 
   "\!\(\*SubscriptBox[\(γ\), \(42\)]\)"}}, 
 VertexLabeling -> True, DirectedEdges -> True, 
 VertexCoordinateRules -> {Subscript[ξ, 1] -> {0, 3}, 
   Subscript[ξ, 2] -> {0, 0}, Subscript[X, 3] -> {Sqrt[3], 1}, 
   Subscript[X, 4] -> {Sqrt[3], -1}, Subscript[X, 2] -> {Sqrt[3], 2}, 
   Subscript[X, 1] -> {Sqrt[3], 4}, 
   Subscript[δ, 1] -> {Sqrt[3] + 1, 4}, 
   Subscript[δ, 2] -> {Sqrt[3] + 1, 2}, 
   Subscript[δ, 3] -> {Sqrt[3] + 1, 1}, 
   Subscript[δ, 4] -> {Sqrt[3] + 1, -1}}, ImageSize -> 320]

results something like

enter image description here

when I use the drawing tool to make the text and arrow head bigger, the vertex labels disappear

enter image description here

Why that happens and how to get around that? I'm using version 8 on Mac. This also happens in version 8 on Windows 7.

share|improve this question
    
On version 9 (Mac) you can change the size of the labels freely (and they're still visible), but as soon as I touch the Arrowhead sliders they disappear and don't come back. –  cormullion Apr 20 '13 at 19:47

1 Answer 1

up vote 2 down vote accepted

Since this is a problem of the interactive drawing interface, it may be OK to work around it in an interactive way, too. It's a hack, of course, but don't blame me.

Here is a sequence of steps that works. It's based on point-and-click interaction, so I can best describe it visually in steps. For that reason, I made the ImageSize in the original graph smaller:

GraphPlot[{Subscript[δ, 1] -> Subscript[X, 1], 
  Subscript[δ, 2] -> Subscript[X, 2], 
  Subscript[δ, 3] -> Subscript[X, 3], 
  Subscript[δ, 4] -> Subscript[X, 4], 
  Subscript[ξ, 1] -> 
   Subscript[ξ, 2], {Subscript[ξ, 2] -> Subscript[ξ, 1], 
   "\!\(\*SubscriptBox[\(ϕ\), \(21\)]\)"}, {Subscript[ξ, 
     1] -> Subscript[X, 1], 
   "\!\(\*SubscriptBox[\(γ\), \(11\)]\)"}, {Subscript[ξ, 
     1] -> Subscript[X, 2], 
   "\!\(\*SubscriptBox[\(γ\), \(21\)]\)"}, {Subscript[ξ, 
     2] -> Subscript[X, 3], 
   "\!\(\*SubscriptBox[\(γ\), \(32\)]\)"}, {Subscript[ξ, 
     2] -> Subscript[X, 4], 
   "\!\(\*SubscriptBox[\(γ\), \(42\)]\)"}}, 
 VertexLabeling -> True, DirectedEdges -> True, 
 VertexCoordinateRules -> {Subscript[ξ, 1] -> {0, 3}, 
   Subscript[ξ, 2] -> {0, 0}, Subscript[X, 3] -> {Sqrt[3], 1}, 
   Subscript[X, 4] -> {Sqrt[3], -1}, Subscript[X, 2] -> {Sqrt[3], 2}, 
   Subscript[X, 1] -> {Sqrt[3], 4}, 
   Subscript[δ, 1] -> {Sqrt[3] + 1, 4}, 
   Subscript[δ, 2] -> {Sqrt[3] + 1, 2}, 
   Subscript[δ, 3] -> {Sqrt[3] + 1, 1}, 
   Subscript[δ, 4] -> {Sqrt[3] + 1, -1}}, ImageSize -> 120]

Now copy the output into a new line, pasting it twice into a Show statement as follows:

step1

Don't evaluate the cell yet. First invoke the graphics editor and modify the left-hand plot by changing the arrow heads in the right-hand plot to your liking.

step2

Still don't evaluate the cell yet. Change the Opacity of the edges in the right-hand plot until they are invisible:

step 3

Then evaluate the Show:

result

So I superimposed two copies, one with the right arrows but no labels, and one with no labels but the right arrows. The latter has to be drawn first so that the labels are shown on top.

share|improve this answer
    
That works! Thanks! –  user0501 May 20 at 17:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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