diff --git a/zUtil_Drawing/gtFigureCreateEBSDMapIPF.m b/zUtil_Drawing/gtFigureCreateEBSDMapIPF.m index 644c1ce610ba8145c6d231bc8ca5279e0ecb6508..b559076940f23a27fab97ed48cf49086e35b7621 100644 --- a/zUtil_Drawing/gtFigureCreateEBSDMapIPF.m +++ b/zUtil_Drawing/gtFigureCreateEBSDMapIPF.m @@ -27,6 +27,7 @@ function gtFigureCreateEBSDMapIPF(EBSD_struct, varargin) 'pixel_to_cm', 0.05, ... 'borders', false, ... 'colorbar', false, ... + 'filename', [], ... 'extras', [] ); conf = parse_pv_pairs(conf, varargin); @@ -111,12 +112,22 @@ function gtFigureCreateEBSDMapIPF(EBSD_struct, varargin) imagesc(final_slice_RGB, 'Parent', ax); if (~isempty(conf.extras)) + if (~isempty(conf.scale)) + pix_size = EBSD_struct.pixel_size ./ conf.scale; + else + pix_size = EBSD_struct.pixel_size; + end im_props = struct( ... - 'pixel_size', EBSD_struct.pixel_size, ... + 'pixel_size', pix_size, ... 'size', img_size ); gtFigureAddExtras(ax, im_props, conf.extras); end + set(ax, 'xtick', []) + set(ax, 'xticklabel', []) + set(ax, 'ytick', []) + set(ax, 'yticklabel', []) + gtFigureSetSize(f, ax, conf, img_size) if (~isempty(conf.filename)) diff --git a/zUtil_Drawing/gtFigureSetSize.m b/zUtil_Drawing/gtFigureSetSize.m index 12ee47cc6dbd684c99a0038a7790bd2b2cafeeb9..72de521e71baa072afb20180bd2b889a1876d8ab 100644 --- a/zUtil_Drawing/gtFigureSetSize.m +++ b/zUtil_Drawing/gtFigureSetSize.m @@ -1,6 +1,6 @@ function gtFigureSetSize(f, ax, conf, img_size) if (exist('img_size', 'var') && ~isempty(img_size)) - img_size = img_size * conf.pixel_to_cm; + img_size = img_size .* conf.pixel_to_cm; else img_size = conf.figure_size; end @@ -8,9 +8,9 @@ function gtFigureSetSize(f, ax, conf, img_size) set(f, 'Units', 'centimeters') if (~conf.borders) if (~conf.colorbar) - figure_position = [0, 0, img_size]; + figure_position = [1, 1, img_size]; else - figure_position = [0, 0, img_size] + [0, 0, 3, 1]; + figure_position = [1, 1, img_size] + [0, 0, 3, 1]; end set(f, 'Position', figure_position) set(f, 'Paperposition', figure_position) @@ -46,11 +46,11 @@ function gtFigureSetSize(f, ax, conf, img_size) set(ax, 'Units', 'centimeters') if (~conf.colorbar) - figure_position = [0, 0, img_size] + [0, 0, 2, size_padding]; + figure_position = [1, 1, img_size] + [0, 0, 2, size_padding]; set(f, 'Position', figure_position) set(f, 'Paperposition', figure_position) else - figure_position = [0, 0, img_size] + [0, 0, 3.5, size_padding+0.5]; + figure_position = [1, 1, img_size] + [0, 0, 3.5, size_padding+0.5]; set(f, 'Position', figure_position) set(f, 'Paperposition', figure_position) @@ -74,4 +74,5 @@ function gtFigureSetSize(f, ax, conf, img_size) box(ax, 'Off') grid(ax, 'Off') fprintf('Figure size: [%g, %g] cm\n', figure_position(3:4)) + drawnow(); end \ No newline at end of file