Skip to content

Commit 41d462d

Browse files
Fix marker size issue when plotting single points
1 parent 25fd783 commit 41d462d

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

plotly/Test_plotlyfig.m

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,29 @@ function testSingleScatterPlotData(tc)
227227
p = plotlyfig(fig,"visible","off");
228228

229229
tc.verifyNumElements(p.data, 1);
230-
tc.verifyEqual(p.data{1}.x, {x});
231-
tc.verifyEqual(p.data{1}.y, {y});
230+
tc.verifyEqual(p.data{1}, struct( ...
231+
type = "scatter", ...
232+
xaxis = "x1", ...
233+
yaxis = "y1", ...
234+
mode = "markers", ...
235+
visible = true, ...
236+
name = '', ...
237+
x = {{x}}, ...
238+
y = {{y}}, ...
239+
marker = struct( ...
240+
sizeref = 1, ...
241+
sizemode = 'area', ...
242+
size = {{36}}, ...
243+
line = struct( ...
244+
width = 0.7500, ...
245+
color = "rgb(0,114,189)" ...
246+
), ...
247+
symbol = 'circle', ...
248+
color = "rgba(0,0,0,0)", ...
249+
opacity = 1 ...
250+
), ...
251+
showlegend = false ...
252+
));
232253
end
233254

234255
function testScatter3DPlotData(tc)

plotly/plotlyfig_aux/helpers/extractScatterMarker.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,8 @@
181181
dataSize = size(plotData.RData); % polar plot
182182
end
183183
markerSize = markerSize * ones(dataSize);
184+
if isscalar(markerSize)
185+
markerSize = {markerSize};
186+
end
184187
end
185188
end

0 commit comments

Comments
 (0)