javascript - Plotly.js adds top-margin to graphs inconsistently, how to prevent it -
with plotly.js i'm getting top-margin added (not consistently), total height of graph 300px, graph 150px high. svg container stretched , actual graph smaller. can prevent white-space, , why show selectively?
plotly matlab syntax results in 300px div instead of 300px graph:
`% plot mean movement data = {... struct(... 'x', nscan, ... 'y',fastmotion, ... 'type', 'scatter')... }; if max(fastmotion) < 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;`
so apparently line 68 in plotlyfig.m caused issue:
obj.plotlydefaults.mintitlemargin = 80;
even though had no title, added 80 px on top of graph, maxing out @ specified graph height. setting value 0 solves problem.
Comments
Post a Comment