title: Plot horizontal bar chart with "nice alignment" of label
body: <p>I am trying to plot the following code. But in my Y axis I want labels as <code>feature_1</code>, <code>feature_2</code> etc. But, when I am plotting the labels are not clear. It is congested. Can anyone help me out.</p>
  
  <pre><code>"""
  Simple demo of a horizontal bar chart.
  """
  import matplotlib.pyplot as plt; plt.rcdefaults()
  import numpy as np
  import matplotlib.pyplot as plt
  
  
  # Example data
  
  important_features = [(0.0457, 'feat_34'), (0.042, 'feat_11'), (0.0359, 'feat_25'), (0.0355, 'feat_60'), (0.0316, 'feat_40'), (0.0298, 'feat_14'), (0.0272, 'feat_80'), (0.0252, 'feat_42'), (0.0241, 'feat_86'), (0.0236, 'feat_67'), (0.0232, 'feat_15'), (0.0217, 'feat_62'), (0.02, 'feat_24'), (0.0196, 'feat_26'), (0.0191, 'feat_54'), (0.0189, 'feat_36'), (0.0183, 'feat_48'), (0.0177, 'feat_75'), (0.016, 'feat_88'), (0.0155, 'feat_64'), (0.0147, 'feat_90'), (0.014, 'feat_72'), (0.014, 'feat_69'), (0.0131, 'feat_9'), (0.0131, 'feat_8'), (0.0131, 'feat_57'), (0.0129, 'feat_43'), (0.0126, 'feat_32'), (0.0126, 'feat_16'), (0.012, 'feat_76'), (0.0117, 'feat_33'), (0.0109, 'feat_68'), (0.0109, 'feat_4'), (0.0107, 'feat_39'), (0.0106, 'feat_70'), (0.0104, 'feat_78'), (0.0103, 'feat_59'), (0.0101, 'feat_53'), (0.0096, 'feat_85'), (0.0087, 'feat_38'), (0.0086, 'feat_47'), (0.0083, 'feat_50'), (0.0083, 'feat_46'), (0.0079, 'feat_92'), (0.0078, 'feat_71'), (0.0078, 'feat_30'), (0.0076, 'feat_17'), (0.0073, 'feat_66'), (0.007, 'feat_41'), (0.0069, 'feat_13'), (0.0068, 'feat_83'), (0.0068, 'feat_73'), (0.0068, 'feat_56'), (0.0066, 'feat_20'), (0.0064, 'feat_1'), (0.0062, 'feat_37'), (0.0061, 'feat_27'), (0.006, 'feat_87'), (0.006, 'feat_2'), (0.0058, 'feat_58'), (0.0058, 'feat_35'), (0.0058, 'feat_22'), (0.0056, 'feat_18'), (0.0055, 'feat_55'), (0.0054, 'feat_74'), (0.0053, 'feat_91'), (0.0053, 'feat_79'), (0.005, 'feat_29'), (0.0049, 'feat_44'), (0.0046, 'feat_89'), (0.0045, 'feat_45'), (0.0041, 'feat_10'), (0.0039, 'feat_19'), (0.0037, 'feat_21'), (0.0035, 'feat_3'), (0.0033, 'feat_65'), (0.0031, 'feat_7'), (0.003, 'feat_23'), (0.0029, 'feat_63'), (0.0029, 'feat_52'), (0.0028, 'feat_77'), (0.0027, 'feat_49'), (0.0025, 'feat_12'), (0.0022, 'feat_93'), (0.0021, 'feat_28'), (0.002, 'feat_61'), (0.002, 'feat_5'), (0.0019, 'feat_81'), (0.0017, 'feat_31'), (0.0011, 'feat_84'), (0.0011, 'feat_51'), (0.0009, 'feat_82'), (0.0009, 'feat_6')]
  
  x_value = []
  y_feat = []
  for (a, b) in important_features:
      y_feat.append(b)
      x_value.append(a)
  
  features = y_feat
  y_pos = range(1,2*len(features),2)
  
  performance = x_value
  
  
  plt.barh(y_pos, performance, align='center', alpha=0.4)
  plt.yticks(y_pos, features)
  plt.ylim(0,200)
  plt.xlabel('Values')
  plt.title('Feature Plot')
  
  plt.show()
  </code></pre>