title: Plotly.js adds top-margin to graphs inconsistently, how to prevent it
body: <p>With Plotly.js I'm getting a top-margin added sometimes (not consistently), where the total height of the graph is 300px, but the graph itself is only 150px high. The SVG container then is stretched and the actual graph is smaller. What can I do to prevent this white-space, and why does it only show up selectively?  </p>
  
  <p><a href="https://i.stack.imgur.com/P1NrR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/P1NrR.png" alt="Margin above graph"></a></p>
  
  <p>Plotly Matlab syntax that results in 300px div instead of a 300px graph:</p>
  
  <pre><code>`% PLOT MEAN MOVEMENT
      data = {...
        struct(...
          'x', nScan, ...
          'y',fastmotion, ...
           'type', 'scatter')...
           };
      if max(fastmotion) &lt; 0.3
          yminval = 0.3;
      else
          yminval = round(max(fastmotion) + 1);
      end
      layout = struct(...
      'yaxis', struct(...
      'title', 'Movement (mm)', ...
      'range', [0, yminval]));
      header{3} = 'Absolute Movement';
      layout.width = 800;
      layout.height = 300;
      p = plotlyfig; 
      p.data = data;
      p.layout = layout;
      p.PlotOptions.FileName = 'plot_5';
      html_file = plotlyoffline(p);
      html_file;`
  </code></pre>