Skip to content

Commit

Permalink
Fixed issue altmany#236: axes exponent cropped from output if on righ…
Browse files Browse the repository at this point in the history
…t-hand axes
  • Loading branch information
altmany committed Feb 27, 2018
1 parent 7720793 commit 5f4c67c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,13 @@
% 15/09/17: Fixed issue #210: initialize alpha map to ones instead of zeros when -transparent is not used
% 18/09/17: Added -font_space option to replace font-name spaces in EPS/PDF (workaround for issue #194)
% 18/09/17: Added -noinvert option to solve some export problems with some graphic cards (workaround for issue #197)
% 08/11/17: Fixed issue #220: exponent is removed in HG1 when TickMode is 'manual' (internal Matlab bug)
% 08/11/17: Fixed issue #220: axes exponent is removed in HG1 when TickMode is 'manual' (internal Matlab bug)
% 08/11/17: Fixed issue #221: alert if the requested folder does not exist
% 19/11/17: Workaround for issue #207: alert when trying to use transparent bgcolor with -opengl
% 29/11/17: Workaround for issue #206: warn if exporting PDF/EPS for a figure that contains an image
% 11/12/17: Fixed issue #230: use OpenGL renderer when exported image contains transparency (also see issue #206)
% 30/01/18: Updated SVG message to point to https://github.com/kupiqu/plot2svg and display user-selected filename if available
% 27/02/18: Fixed issue #236: axes exponent cropped from output if on right-hand axes
%}

if nargout
Expand Down Expand Up @@ -1365,7 +1366,12 @@ function set_tick_mode(Hlims, ax)
props = {[ax 'TickMode'],'manual', [ax 'TickLabelMode'],'manual'};
tickVals = get(hAxes,[ax 'Tick']);
tickStrs = get(hAxes,[ax 'TickLabel']);
if isempty(strtrim(hAxes.([ax 'Ruler']).SecondaryLabel.String))
try % Fix issue #236
exponents = [hAxes.([ax 'Axis']).SecondaryLabel];
catch
exponents = [hAxes.([ax 'Ruler']).SecondaryLabel];
end
if isempty([exponents.String])
% Fix for issue #205 - only set manual ticks when the Ticks number match the TickLabels number
if numel(tickVals) == numel(tickStrs)
set(hAxes, props{:}); % no exponent and matching ticks, so update both ticks and tick labels to manual
Expand Down

0 comments on commit 5f4c67c

Please sign in to comment.