Skip to content

Commit 71f8ae3

Browse files
Use ax variable
1 parent 228174b commit 71f8ae3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

plotly/plotlyfig_aux/core/updateData.m

+3-5
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
ax = obj.State.Plot(dataIndex).AssociatedAxis;
186186
if ~ismember(ax.Type,specialAxisPlots())
187187
%-AXIS INDEX-%
188-
axIndex = obj.getAxisIndex(obj.State.Plot(dataIndex).AssociatedAxis);
188+
axIndex = obj.getAxisIndex(ax);
189189

190190
%-CHECK FOR MULTIPLE AXES-%
191191
[xsource, ysource] = findSourceAxis(obj,axIndex);
@@ -204,8 +204,7 @@
204204
% check for xaxis categories
205205
if strcmpi(xaxis.type, "category") && ...
206206
~any(strcmp(obj.data{dataIndex}.type,["heatmap" "box"]))
207-
obj.data{dataIndex}.x = ...
208-
obj.State.Plot(dataIndex).AssociatedAxis.XTickLabel;
207+
obj.data{dataIndex}.x = ax.XTickLabel;
209208
obj.layout.("xaxis" + xsource).autotick = true;
210209
end
211210

@@ -219,8 +218,7 @@
219218
% check for yaxis categories
220219
if strcmpi(yaxis.type, "category") && ...
221220
~any(strcmp(obj.data{dataIndex}.type, ["heatmap" "box"]))
222-
obj.data{dataIndex}.y = ...
223-
obj.State.Plot(dataIndex).AssociatedAxis.YTickLabel;
221+
obj.data{dataIndex}.y = ax.YTickLabel;
224222
obj.layout.("yaxis" + xsource).autotick = true;
225223
end
226224
end

0 commit comments

Comments
 (0)