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 )
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With