#NEWLINE# def visualize( self , trellis_length = 2 , state_order = None , state_radius = 0.04 , edge_colors = None ) : #NEWLINE# #INDENT# ' Plot the trellis diagram.\n\n        Parameters\n        ----------\n        trellis_length : int, optional\n            Specifies the number of time steps in the trellis diagram.\n            Default value is 2.\n\n        state_order : list of ints, optional\n            Specifies the order in the which the states of the trellis\n            are to be displayed starting from the top in the plot.\n            Default order is [0,...,number_states-1]\n\n        state_radius : float, optional\n            Radius of each state (circle) in the plot.\n            Default value is 0.04\n\n        edge_colors = list of hex color codes, optional\n            A list of length equal to the number_inputs,\n            containing color codes that represent the edge corresponding\n            to the input.\n\n        ' #NEWLINE# if ( edge_colors is None ) : #NEWLINE# #INDENT# edge_colors = [ '#9E1BE0' , '#06D65D' ] #NEWLINE# #UNINDENT# if ( state_order is None ) : #NEWLINE# #INDENT# state_order = range ( self . number_states ) #NEWLINE# #UNINDENT# font = 'sans-serif' #NEWLINE# fig = plt . figure ( ) #NEWLINE# ax = plt . axes ( [ 0 , 0 , 1 , 1 ] ) #NEWLINE# trellis_patches = [ ] #NEWLINE# state_order . reverse ( ) #NEWLINE# trellis_grid = self . _generate_grid ( trellis_length ) #NEWLINE# state_patches = self . _generate_states ( trellis_length , collection , state_order , state_radius , font ) #NEWLINE# edge_patches = self . _generate_edges ( trellis_length , trellis_grid , state_order , state_radius , edge_colors ) #NEWLINE# self . _generate_labels ( trellis_grid , state_order , state_radius , font ) #NEWLINE# trellis_patches . extend ( state_patches ) #NEWLINE# trellis_patches . extend ( edge_patches ) #NEWLINE# collection = PatchCollection ( trellis_patches , match_original = True ) #NEWLINE# ax . add_collection ( collection ) #NEWLINE# ax . set_xticks ( [ ] ) #NEWLINE# ax . set_yticks ( [ ] ) #NEWLINE# plt . show ( )