Skip to content

Commit 620f32d

Browse files
authoredOct 12, 2021
Merge pull request #409 from plotly/fix_issue_related_to_xscale_when_log-scale_is_set
fix issue related to xscale when log scale is set
2 parents 274e18d + 0532840 commit 620f32d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎plotly/plotlyfig_aux/helpers/extractAxisData.m

+6-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@
122122
end
123123

124124
if isnumeric(axisLim)
125-
axis.range = axisLim;
125+
if strcmp(axis.type, 'linear')
126+
axis.range = axisLim;
127+
elseif strcmp(axis.type, 'log')
128+
axis.range = log10(axisLim);
129+
end
130+
126131
else
127132
axis.autorange = true;
128133
end
@@ -133,7 +138,6 @@
133138

134139
%-set tick labels by using tick values and tick texts-%
135140
if ~isempty(tickValues) && ~isempty(tickLabels)
136-
137141
axis.tickmode = 'array';
138142
axis.tickvals = tickValues;
139143
axis.ticktext = tickLabels;
@@ -142,7 +146,6 @@
142146

143147
%-set tick labels by using only tick values-%
144148
elseif ~isempty(tickValues) && isempty(tickLabels)
145-
146149
axis.tickmode = 'array';
147150
axis.tickvals = tickValues;
148151

0 commit comments

Comments
 (0)
Please sign in to comment.