title: Saved png is not as the Matlab figure
body: <p>I'm using the below code to save a png from a Matlab figure. But for some reason they are not the same. If anyone could please advise.</p>
  
  <p>This is the code used:</p>
  
  <pre><code>fig1=figure('visible','off');
  b = bar(bar_res);
  x={'a' ;'b' ;'c'; 'd' ;'e'; 'f' ;'g'; 'h';...
       'i'; 'j' ;'k'; 'l'; 'm'; 'n' ;'o'; 'p' ;'q' ;'r'; 's';...
       't';'u'};
  set(gca,'XTickLabel',x,'XTick',1:21);
  rotateXLabels( gca, 90 );
  with=char('Res with dash');
  without=char('Res without dash');
  legend('Reference',with,without,'Location','northwest');
  set(gca,'FontSize',16);
  y=ylabel('Number of trials','rot',90,'FontSize',18);
  set(y,'Units','Normalized','Position',[-0.15, 0.5, 0]);
  saveas(gca, 'a.png');
  </code></pre>
  
  <p>Matlab Fig appearing:</p>
  
  <p><img src="https://i.stack.imgur.com/zOHhE.png" alt="enter image description here"></p>
  
  <p>PNG saved:
  <img src="https://i.stack.imgur.com/mS2Uy.png" alt="enter image description here"></p>