8

I've plotted a markov chain in R, but I dislike the rather hugh arrowheads that the plot-function is plotting. Is there a way to make the heads smaller?

library( markovchain )

transition.matrix <- matrix( data = c( 0.5, 0, 0, 0.5, 0.2, 0, 0, 0.8, 1 ),
                         nrow = 3, ncol = 3,
                         dimnames = list( c( "A", "B", "C" ), c( "A", "B", "C" ) ) )

transition.matrix <- new( "markovchain", transitionMatrix = transition.matrix )

print( transition.matrix )

plot( transition.matrix  )
JimBoy
  • 597
  • 8
  • 18

1 Answers1

11

markovchain uses the igraph package to plot transition matrices, so you can use parameters from that package to adjust the graph. For example, to set the arrowhead size:

plot(transition.matrix, edge.arrow.size=0.5)

For more information on customization, see the igraph manual.

enter image description here

eipi10
  • 91,525
  • 24
  • 209
  • 285