title: Matplotlib - contour plot
body: <p>I am struggling a bit with contour plot in matplotlib. I've read through the instructions and example but can't seem to figure out what I need to do.</p>
  
  <p>I have x, y, z data. The data is basically as follows:</p>
  
  <pre><code>x    y    z
  1.1  2.1  0
  0.9  3.2  1
  2.6  4.1  0
  3.1  1.1  1
  0.3  0.9  1
  ...
  </code></pre>
  
  <p>It is a long list of x-y coordinates and at each point it is a 0-1. The use case is balls(1), strikes(0) crossing the strikezone in baseball. When I plot the data using plt.hexbin you see the following:</p>
  
  <p><img src="https://image.ibb.co/d3YSB7/strikezone.png" alt="strikezone image"></p>
  
  <p>What I want to do is to plot a contour at the 50% line. Like this imagine below:</p>
  
  <p><img src="https://baseballwithr.files.wordpress.com/2015/05/joewestcontourplot.png" alt="50% contour plot"></p>
  
  <p>I was hoping to use contour but I am unclear how I can get the data is a sufficient format to draw the contour plot and use 'levels' to plot just the 50% contour. Apparently the function <code>contour(X,Y,Z)</code> requires 2-D arrays so based on the data I have I am unclear on what exactly I need to do. </p>
  
  <p>Is there a way I can put the data I have into a function to get the contour plot I want, like with hexbin?</p>