parameters: (self)
return_statement: return
docstring: Here C is the LIST of simplexes S in the
               2 or 3 dimensional complex
  
               To plot a single simplex S in a set C, use ex. [C[0]]
docstring_summary: Here C is the LIST of simplexes S in the
               2 or 3 dimensional complex
docstring_tokens: Here C is the LIST of simplexes S in the 2 or 3 dimensional complex
function: def plot_complex(self):
          """
               Here C is the LIST of simplexes S in the
               2 or 3 dimensional complex
  
               To plot a single simplex S in a set C, use ex. [C[0]]
          """
          from matplotlib import pyplot
          if self.dim == 2:
              pyplot.figure()
              for C in self.H:
                  for c in C:
                      for v in c():
                          if self.bounds is None:
                              x_a = np.array(v.x, dtype=float)
                          else:
                              x_a = np.array(v.x, dtype=float)
                              for i in range(len(self.bounds)):
                                  x_a[i] = (x_a[i] * (self.bounds[i][1]
                                                      - self.bounds[i][0])
                                            + self.bounds[i][0])
  
                          # logging.info('v.x_a = {}'.format(x_a))
  
                          pyplot.plot([x_a[0]], [x_a[1]], 'o')
  
                          xlines = []
                          ylines = []
                          for vn in v.nn:
                              if self.bounds is None:
                                  xn_a = np.array(vn.x, dtype=float)
                              else:
                                  xn_a = np.array(vn.x, dtype=float)
                                  for i in range(len(self.bounds)):
                                      xn_a[i] = (xn_a[i] * (self.bounds[i][1]
                                                            - self.bounds[i][0])
                                                 + self.bounds[i][0])
  
                              # logging.info('vn.x = {}'.format(vn.x))
  
                              xlines.append(xn_a[0])
                              ylines.append(xn_a[1])
                              xlines.append(x_a[0])
                              ylines.append(x_a[1])
  
                          pyplot.plot(xlines, ylines)
  
              if self.bounds is None:
                  pyplot.ylim([-1e-2, 1 + 1e-2])
                  pyplot.xlim([-1e-2, 1 + 1e-2])
              else:
                  pyplot.ylim(
                      [self.bounds[1][0] - 1e-2, self.bounds[1][1] + 1e-2])
                  pyplot.xlim(
                      [self.bounds[0][0] - 1e-2, self.bounds[0][1] + 1e-2])
  
              pyplot.show()
  
          elif self.dim == 3:
              fig = pyplot.figure()
              ax = fig.add_subplot(111, projection='3d')
  
              for C in self.H:
                  for c in C:
                      for v in c():
                          x = []
                          y = []
                          z = []
                          # logging.info('v.x = {}'.format(v.x))
                          x.append(v.x[0])
                          y.append(v.x[1])
                          z.append(v.x[2])
                          for vn in v.nn:
                              x.append(vn.x[0])
                              y.append(vn.x[1])
                              z.append(vn.x[2])
                              x.append(v.x[0])
                              y.append(v.x[1])
                              z.append(v.x[2])
                              # logging.info('vn.x = {}'.format(vn.x))
  
                          ax.plot(x, y, z, label='simplex')
  
              pyplot.show()
          else:
              print("dimension higher than 3 or wrong complex format")
          return
function_tokens: def plot_complex ( self ) : from matplotlib import pyplot if self . dim == 2 : pyplot . figure ( ) for C in self . H : for c in C : for v in c ( ) : if self . bounds is None : x_a = np . array ( v . x , dtype = float ) else : x_a = np . array ( v . x , dtype = float ) for i in range ( len ( self . bounds ) ) : x_a [ i ] = ( x_a [ i ] * ( self . bounds [ i ] [ 1 ] - self . bounds [ i ] [ 0 ] ) + self . bounds [ i ] [ 0 ] ) # logging.info('v.x_a = {}'.format(x_a)) pyplot . plot ( [ x_a [ 0 ] ] , [ x_a [ 1 ] ] , 'o' ) xlines = [ ] ylines = [ ] for vn in v . nn : if self . bounds is None : xn_a = np . array ( vn . x , dtype = float ) else : xn_a = np . array ( vn . x , dtype = float ) for i in range ( len ( self . bounds ) ) : xn_a [ i ] = ( xn_a [ i ] * ( self . bounds [ i ] [ 1 ] - self . bounds [ i ] [ 0 ] ) + self . bounds [ i ] [ 0 ] ) # logging.info('vn.x = {}'.format(vn.x)) xlines . append ( xn_a [ 0 ] ) ylines . append ( xn_a [ 1 ] ) xlines . append ( x_a [ 0 ] ) ylines . append ( x_a [ 1 ] ) pyplot . plot ( xlines , ylines ) if self . bounds is None : pyplot . ylim ( [ - 1e-2 , 1 + 1e-2 ] ) pyplot . xlim ( [ - 1e-2 , 1 + 1e-2 ] ) else : pyplot . ylim ( [ self . bounds [ 1 ] [ 0 ] - 1e-2 , self . bounds [ 1 ] [ 1 ] + 1e-2 ] ) pyplot . xlim ( [ self . bounds [ 0 ] [ 0 ] - 1e-2 , self . bounds [ 0 ] [ 1 ] + 1e-2 ] ) pyplot . show ( ) elif self . dim == 3 : fig = pyplot . figure ( ) ax = fig . add_subplot ( 111 , projection = '3d' ) for C in self . H : for c in C : for v in c ( ) : x = [ ] y = [ ] z = [ ] # logging.info('v.x = {}'.format(v.x)) x . append ( v . x [ 0 ] ) y . append ( v . x [ 1 ] ) z . append ( v . x [ 2 ] ) for vn in v . nn : x . append ( vn . x [ 0 ] ) y . append ( vn . x [ 1 ] ) z . append ( vn . x [ 2 ] ) x . append ( v . x [ 0 ] ) y . append ( v . x [ 1 ] ) z . append ( v . x [ 2 ] ) # logging.info('vn.x = {}'.format(vn.x)) ax . plot ( x , y , z , label = 'simplex' ) pyplot . show ( ) else : print ( "dimension higher than 3 or wrong complex format" ) return