plotGraph

Graph.plotGraph(output=None, probX=True, size=(12, 8), **kwargs)

Creates a plot of probability vs node superimposed on a 3D visualisation of the graph vertices.

Parameters:
  • output (str) – the absolute/relative path to the desired output file.
  • probX (bool) – if set to True (default), the probability is represented as bars placed on each graph vertex; if False, the graph is plotted without any probability.
  • size (tuple) – size=(x,y) sets the horizontal and vertical size of the output figure.
Keyword Arguments:
 
  • nodesize (float) – size of the vertices in the plot. If left blank, this is determined automatically.

  • nodecolor (str) – vertex color (default 'red').

    For more details on how to specify a color, see the matplotlib documentation.

  • nodealpha (float) – value between 0 and 1 specifying the vertex opacity (default 0.25)

  • nodetext (bool) – if set True, the vertices are labelled by number.

  • nodetextcolor (str) – vertex label text color (default 'black').

  • nodetextbg (str) – vertex label background color (default 'None').

  • ntofffset (array of floats) – the \((x,y,z)\) vertex label offset relative to the vertex (default [0.,0.,-0.15]).

  • barscale (float) – scaled height of the probability bars (default 1).

  • barcolor (str) – probability bar color (default 'green').

  • baralpha (float) – value between 0 and 1 specifying the opacity (default 0.25)

  • bartext (bool) – if set True, the probability bars are labelled with their value.

  • bartextcolor (str) – probability label text color (default 'black').

  • bartextbg (str) – probability label background color (default 'None').

  • btoffset (array of floats) – the \((x,y,z)\) probability label offset relative to the top of the probability bars (default [-0.025,-0.025,0.05])

Note

  • ensure a file extension is present so that file type is correctly set (choose one of png, pdf, ps, eps or svg).
  • if propagate() has not been called, the probability of the initial state is plotted (\(t=0\)). Otherwise, the last propagated time (walk.t) is used.