Skip to content

Commit

Permalink
Added functionality to manipulate legend axes
Browse files Browse the repository at this point in the history
  • Loading branch information
piermorel committed May 31, 2016
1 parent 0185030 commit b1f4faa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions @gramm/gramm.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
% Pierre Morel 2015

properties (Access=public)
legend_axe_handle %Store the handle of the legend axis
title_axe_handle %Store the handle of the title axis
facet_axes_handles %Stores the handles of the facet axes
results %Stores the results of the draw functions and statistics computations
end
Expand Down Expand Up @@ -109,8 +111,7 @@

legend_y=0 %Current y position of the legend text

legend_axe_handle %Store the handle of the legend axis
title_axe_handle %Store the handle of the title axis


bigtitle=''
bigtitle_options={}
Expand Down
4 changes: 2 additions & 2 deletions @gramm/redraw.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
end
end

if ~isempty(legend_text_pos)
if ~isempty(legend_text_pos) && obj.with_legend
%Here we correct by the width to get the coordinates in
%normalized values
[max_text_x,max_ind]=max(cellfun(@(p)legend_pos(1)+legend_pos(3)*(p(1)+p(3))/legend_axis_width,legend_text_pos));
Expand Down Expand Up @@ -238,7 +238,7 @@

%If we don't have legends on the right then we use the multi parameters
temp_available_x=obj.multi.orig(2)+obj.multi.size(2);
if ~isempty(legend_text_pos) %Place relative to legend axis if we have one
if ~isempty(legend_text_pos) && obj.with_legend %Place relative to legend axis if we have one
tmp=get(obj.legend_axe_handle,'Position');
temp_available_x=tmp(1);
end
Expand Down

0 comments on commit b1f4faa

Please sign in to comment.