diff --git a/plotly/Test_plotlyfig.m b/plotly/Test_plotlyfig.m index 4e839c8f..d91c6e19 100644 --- a/plotly/Test_plotlyfig.m +++ b/plotly/Test_plotlyfig.m @@ -51,6 +51,18 @@ function testLinePlotDatetimeXaxis(tc) try close(); catch; end end + function testFigureSizeLayout(tc) + fig = figure("Visible","off","Units","pixels","Position",[100 100 500 300]); + plot(1:3); + + p = plotlyfig(fig,"visible","off"); + + figurePosition = get(fig, "Position"); + tc.verifyEqual(p.layout.width, figurePosition(3)); + tc.verifyEqual(p.layout.height, figurePosition(4)); + try close(); catch; end + end + function testLinePlotLayout(tc) fig = figure("Visible","off"); y = [0.0301 0.4411 0.7007 0.7030 0.5102 0.6122 0.7464 0.8014 0.3367 0.5641]; diff --git a/plotly/plotlyfig.m b/plotly/plotlyfig.m index e3b8cdcf..e86dd392 100644 --- a/plotly/plotlyfig.m +++ b/plotly/plotlyfig.m @@ -86,7 +86,6 @@ "MinTitleMargin", 10, ... "TitleHeight", 0.01, ... "TitleFontSizeIncrease", 40, ... - "FigureIncreaseFactor", 1.5, ... "AxisLineIncreaseFactor", 1.5, ... "MarginPad", 0, ... "MaxTickLength", 20, ... diff --git a/plotly/plotlyfig_aux/core/updateFigure.m b/plotly/plotlyfig_aux/core/updateFigure.m index ffdc252d..274d215b 100644 --- a/plotly/plotlyfig_aux/core/updateFigure.m +++ b/plotly/plotlyfig_aux/core/updateFigure.m @@ -61,8 +61,8 @@ h = figurePosition(4); end - obj.layout.width = w * obj.PlotlyDefaults.FigureIncreaseFactor; - obj.layout.height = h * obj.PlotlyDefaults.FigureIncreaseFactor; + obj.layout.width = w; + obj.layout.height = h; col = round(255*obj.State.Figure.OriginalColor); obj.layout.paper_bgcolor = getStringColor(col);