Skip to content
Snippets Groups Projects
Commit d97e1347 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Figures: more fixes for EBSD and figure sizes

parent 4a253802
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment