title: Matplotlib ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
body: <p>When I use the following code below to make a plot, in which I assign customized values to the x axis and set <code>xlim</code>, it works out.</p>
  
  <pre><code>x = np.array([0,1,2,3])
  y = np.array([0.650, 0.660, 0.675, 0.685])
  customized_x = np.array([3, 4, 5, 6])
  plt.xticks(x, customized_x)
  plt.xlim(2, 3)
  plt.plot(x, y)
  plt.show()
  </code></pre>
  
  <p>However, because I want to make a few more plots together, when I use subplot instead, it pops out at the line <code>ax1.set_xticks(x, customized_x)</code>:</p>
  
  <pre><code>fig = plt.figure(figsize=[6.0, 9.0])
  ax1 = fig.add_subplot(111)
  
  x = np.array([0,1,2,3])
  y = np.array([0.650, 0.660, 0.675, 0.685])
  customized_x = np.array([3, 4, 5, 6])
  ax1.set_xticks(x, customized_x)
  ax1.set_xlim(2, 3)
  ax1.plot(x, y)
  plt.show()
  </code></pre>
  
  <p>Error obtained:</p>
  
  <pre><code>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() 
  </code></pre>
  
  <p>Although 
  I can avoid the issue by not using subplots, I am still wondering what's wrong with subplots?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I find a <a href="https://stackoverflow.com/questions/21910986/why-set-xticks-doesnt-set-the-labels-of-ticks">solution to the similar question here</a>. Sorry for the repetition.</p>