title: Basic plotting of wavelet analysis output in matplotlib
body: <p>I am discovering wavelets in practice thanks to the python module <a href="http://www.pybytes.com/pywavelets/" rel="nofollow noreferrer">pywt</a>.</p>
  
  <p>I have browsed <a href="https://github.com/nigma/pywt/tree/master/demo" rel="nofollow noreferrer">some examples of the pywt module usage</a>, but I could not grasp the essential step: I don't know how to display the multidimensionnal output of a wavelet analysis <strong>with matplotlib</strong>, basically.</p>
  
  <p>This is what I tried, (given one pyplot axe <code>ax</code>):</p>
  
  <pre><code>import pywt
  
  data_1_dimension_series = [0,0.1,0.2,0.4,-0.1,-0.1,-0.3,-0.4,1.0,1.0,1.0,0] 
  # indeed my data_1_dimension_series is much longer
  
  cA, cD = pywt.dwt(data_1_dimension_series, 'haar')
  
  ax.set_xlabel('seconds')
  ax.set_ylabel('wavelet affinity by scale factor')
  
  ax.plot(axe_wt_time, zip(cA,cD))
  </code></pre>
  
  <p>or also </p>
  
  <pre><code>data_wt_analysis = pywt.dwt(data_1_dimension_series, 'haar')
  ax.plot(axe_wt_time, data_wt_analysis) 
  </code></pre>
  
  <p>Both <code>ax.plot(axe_wt_time, data_wt_analysis)</code> and <code>ax.plot(axe_wt_time, zip(cA,cD))</code> are not appropriate and returns error. Both throws <code>x and y must have the same first dimension</code></p>
  
  <p>The thing is <code>data_wt_analysis</code> does contain several 1D series, one for each wavelet scale factor. 
  I surely could display as many graphs as there are scale factors. But I want them all in the same graph.</p>
  
  <p>How could I simply display such data, in only one graph, <strong>with matplotlib</strong> ?</p>
  
  <p>Something like the colourful square below:</p>
  
  <p><img src="https://i.stack.imgur.com/yo50p.gif" alt="enter image description here"></p>