File tree 1 file changed +5
-2
lines changed
plotly/plotlyfig_aux/handlegraphics
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ function updateLineseries(obj, plotIndex)
51
51
obj.data{plotIndex }.type = ' scatterpolar' ;
52
52
updateDefaultPolaraxes(obj , plotIndex )
53
53
obj.data{plotIndex }.subplot = sprintf(' polar%d ' , xSource + 1 );
54
-
55
54
elseif ~isPlot3D
56
55
obj.data{plotIndex }.type = ' scatter' ;
57
56
obj.data{plotIndex }.xaxis = sprintf(' x%d ' , xSource );
@@ -73,11 +72,15 @@ function updateLineseries(obj, plotIndex)
73
72
if isPolar
74
73
obj.data{plotIndex }.r = rData ;
75
74
obj.data{plotIndex }.theta = thetaData ;
76
-
77
75
else
78
76
obj.data{plotIndex }.x = xData ;
79
77
obj.data{plotIndex }.y = yData ;
80
78
79
+ if isscalar(xData ) % plotly has trouble plotting a single point
80
+ obj.data{plotIndex }.x = repmat(obj.data{plotIndex }.x,[1 ,2 ]);
81
+ obj.data{plotIndex }.y = repmat(obj.data{plotIndex }.y,[1 ,2 ]);
82
+ end
83
+
81
84
if isPlot3D
82
85
obj.data{plotIndex }.z = zData ;
83
86
obj.PlotOptions.is3d = true ;
You can’t perform that action at this time.
0 commit comments