Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions plotly/Test_plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 0 additions & 1 deletion plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"MinTitleMargin", 10, ...
"TitleHeight", 0.01, ...
"TitleFontSizeIncrease", 40, ...
"FigureIncreaseFactor", 1.5, ...
"AxisLineIncreaseFactor", 1.5, ...
"MarginPad", 0, ...
"MaxTickLength", 20, ...
Expand Down
4 changes: 2 additions & 2 deletions plotly/plotlyfig_aux/core/updateFigure.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading