title: Matlab : Combined histograms
body: <p>I try to combine with a &quot;hold on&quot; several histograms that I get from several figures. The figures have the same X axis that I defined. Nevertheless I can't display. Would you have a solution?</p>
  <pre><code>close all;
  clearvars;
  
  xlimArr = [0 0.05];
  
  dataset = xlsread('DEHS_REF.xlsx', 'Feuil1', 'A2:B47');
  
  h0=hgload('Données_LOAC_n°0_DEHS_1');
  h1=hgload('Données_LOAC_n°1_DEHS_1');
  h2=hgload('Données_LOAC_n°2_DEHS_1');
  h3=hgload('Données_LOAC_n°3_DEHS_1');
  
  g0 = findobj(h0, 'type', 'Histogram');
  g1 = findobj(h0, 'type', 'Histogram');
  g2 = findobj(h0, 'type', 'Histogram');
  g3 = findobj(h0, 'type', 'Histogram');
  
  hist_chanel_1  = g0(2);
  hist_chanel_2  = g1(2);
  hist_chanel_3  = g2(2);
  hist_chanel_4  = g3(2);
  
  figure();
  
  histogram(hist_chanel_1.Data, 'BinWidth', hist_chanel_1.BinWidth);
  hold on 
  histogram(hist_chanel_2.Data, 'BinWidth', hist_chanel_2.BinWidth);
  histogram(hist_chanel_3.Data, 'BinWidth', hist_chanel_3.BinWidth);
  histogram(hist_chanel_4.Data, 'BinWidth', hist_chanel_4.BinWidth);
  hold off
  
  xlabel('Value [V]');
  ylabel('Nb of peak');
  title('AerosolsGenerator peak distribution (amplitude)');
  xlim(xlimArr); ```
  </code></pre>