nodes: 0, module; 1, function_definition; 2, function_name:plot_fracs; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, import_from_statement; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, if_statement; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, expression_statement; 21, expression_statement; 22, try_statement; 23, return_statement; 24, identifier:Q; 25, None; 26, identifier:ax; 27, None; 28, identifier:fignum; 29, None; 30, comment:"""
          Plot fractions of Eigenvalues sorted in descending order.
          """; 31, relative_import; 32, dotted_name; 33, call; 34, assignment; 35, comparison_operator:ax is None; 36, block; 37, comparison_operator:Q is None; 38, block; 39, assignment; 40, assignment; 41, call; 42, call; 43, call; 44, call; 45, call; 46, block; 47, except_clause; 48, identifier:bar; 49, import_prefix; 50, dotted_name; 51, identifier:Tango; 52, attribute; 53, argument_list; 54, identifier:col; 55, call; 56, identifier:ax; 57, None; 58, expression_statement; 59, expression_statement; 60, identifier:Q; 61, None; 62, expression_statement; 63, identifier:ticks; 64, call; 65, identifier:bar; 66, call; 67, attribute; 68, argument_list; 69, attribute; 70, argument_list; 71, attribute; 72, argument_list; 73, attribute; 74, argument_list; 75, attribute; 76, argument_list; 77, expression_statement; 78, block; 79, identifier:plotting; 80, identifier:Tango; 81, identifier:reset; 82, attribute; 83, argument_list; 84, assignment; 85, assignment; 86, assignment; 87, attribute; 88, argument_list; 89, attribute; 90, argument_list; 91, identifier:ax; 92, identifier:set_xticks; 93, identifier:ticks; 94, call; 95, identifier:ax; 96, identifier:set_ylabel; 97, string:"Eigenvalue fraction"; 98, identifier:ax; 99, identifier:set_xlabel; 100, string:"PC"; 101, identifier:ax; 102, identifier:set_ylim; 103, integer:0; 104, subscript; 105, identifier:ax; 106, identifier:set_xlim; 107, binary_operator:ticks.min() - .5; 108, binary_operator:ticks.max() + .5; 109, call; 110, pass_statement; 111, identifier:Tango; 112, identifier:nextMedium; 113, identifier:fig; 114, call; 115, identifier:ax; 116, call; 117, identifier:Q; 118, attribute; 119, identifier:numpy; 120, identifier:arange; 121, identifier:Q; 122, identifier:ax; 123, identifier:bar; 124, binary_operator:ticks - .4; 125, subscript; 126, keyword_argument; 127, identifier:map; 128, argument_list; 129, call; 130, integer:1; 131, call; 132, float:.5; 133, call; 134, float:.5; 135, attribute; 136, argument_list; 137, attribute; 138, argument_list; 139, attribute; 140, argument_list; 141, identifier:self; 142, identifier:Q; 143, identifier:ticks; 144, float:.4; 145, attribute; 146, slice; 147, identifier:color; 148, identifier:col; 149, lambda; 150, binary_operator:ticks + 1; 151, attribute; 152, argument_list; 153, attribute; 154, argument_list; 155, attribute; 156, argument_list; 157, identifier:pylab; 158, identifier:tight_layout; 159, identifier:pylab; 160, identifier:figure; 161, identifier:fignum; 162, identifier:fig; 163, identifier:add_subplot; 164, integer:111; 165, identifier:self; 166, identifier:fracs; 167, identifier:Q; 168, lambda_parameters; 169, call; 170, identifier:ticks; 171, integer:1; 172, identifier:ax; 173, identifier:get_ylim; 174, identifier:ticks; 175, identifier:min; 176, identifier:ticks; 177, identifier:max; 178, identifier:x; 179, attribute; 180, argument_list; 181, string:r"${}$"; 182, identifier:format; 183, identifier:x
code: def plot_fracs(self, Q=None, ax=None, fignum=None):
          """
          Plot fractions of Eigenvalues sorted in descending order.
          """
          from ..plotting import Tango
          Tango.reset()
          col = Tango.nextMedium()
          if ax is None:
              fig = pylab.figure(fignum)
              ax = fig.add_subplot(111)
          if Q is None:
              Q = self.Q
          ticks = numpy.arange(Q)
          bar = ax.bar(ticks - .4, self.fracs[:Q], color=col)
          ax.set_xticks(ticks, map(lambda x: r"${}$".format(x), ticks + 1))
          ax.set_ylabel("Eigenvalue fraction")
          ax.set_xlabel("PC")
          ax.set_ylim(0, ax.get_ylim()[1])
          ax.set_xlim(ticks.min() - .5, ticks.max() + .5)
          try:
              pylab.tight_layout()
          except:
              pass
          return bar