Skip to content

Commit 041f83f

Browse files
Update extractAxisData.m
''
1 parent de0fe47 commit 041f83f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plotly/plotlyfig_aux/helpers/extractAxisData.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,12 @@
204204
axis.autorange = true;
205205
else
206206
%-axis labels
207-
labels = str2double(axis_data.YTickLabel);
207+
labels = str2double(Tick);
208208
try
209+
dataLim = eval(['axis_data.' axisName 'Lim']);
210+
if isnumeric (dataLim)
211+
axis.range = dataLim;
212+
else
209213
%find numbers in labels
210214
labelnums = find(~isnan(labels));
211215
%-axis type linear-%
@@ -214,6 +218,7 @@
214218
delta = (labels(labelnums(2)) - labels(labelnums(1)))/(labelnums(2)-labelnums(1));
215219
axis.range = [labels(labelnums(1))-delta*(labelnums(1)-1) labels(labelnums(1)) + (length(labels)-labelnums(1))*delta];
216220
%-axis autotick-%
221+
end
217222
axis.autotick = true;
218223
%-axis numticks-%
219224
axis.nticks = eval(['length(axis_data.' axisName 'Tick) + 1;']);

0 commit comments

Comments
 (0)