Skip to content
Snippets Groups Projects
Commit 207536be authored by Peter Reischig's avatar Peter Reischig Committed by Nicola Vigano
Browse files

Small changes in gtStrainPlotCompHists.

parent 4beeb399
No related branches found
No related tags found
No related merge requests found
......@@ -2,14 +2,14 @@ function hf = gtStrainPlotCompHists(inp, varargin)
% Plots histograms of the six strain components of all grains.
par.fontsize = 12;
par.edgecolor = 'w';
par.edgecolor = [0.28 0.17 0.11]; %'w';
par.facecolor = [0.28 0.17 0.11];
par.linecolor = 'r';
par.boundnorm = [-0.003 0.003];
par.boundshear = [-0.003 0.003];
par.boundnorm = [-0.01 0.01];
par.boundshear = [-0.01 0.01];
par.binnorm = 0.0002;
par.binshear = 0.0002;
par.ticks = -0.05 : 0.001 : 0.05;
%par.ticks = -0.05 : 0.002 : 0.05;
par = parse_pv_pairs(par, varargin);
......@@ -37,22 +37,22 @@ hf = figure('name','Histograms of strain components','Units','normalized',...
'Position',[0 0.5 0.5 0.5]);
hs(1) = subplot(2,3,1);
sfDrawHist(st, 1,1,'\epsilon_{11}', par)
[minv(1), maxv(1)] = sfDrawHist(st, 1,1,'\epsilon_{11}', par);
hs(2) = subplot(2,3,2);
sfDrawHist(st, 2,2,'\epsilon_{22}', par)
[minv(2), maxv(2)] = sfDrawHist(st, 2,2,'\epsilon_{22}', par);
hs(3) = subplot(2,3,3);
sfDrawHist(st, 3,3,'\epsilon_{33}', par)
[minv(3), maxv(3)] = sfDrawHist(st, 3,3,'\epsilon_{33}', par);
hs(4) = subplot(2,3,4);
sfDrawHist(st, 2,3,'\epsilon_{23}', par)
[minv(4), maxv(4)] = sfDrawHist(st, 2,3,'\epsilon_{23}', par);
hs(5) = subplot(2,3,5);
sfDrawHist(st, 1,3,'\epsilon_{13}', par)
[minv(5), maxv(5)] = sfDrawHist(st, 1,3,'\epsilon_{13}', par);
hs(6) = subplot(2,3,6);
sfDrawHist(st, 1,2,'\epsilon_{12}', par)
[minv(6), maxv(6)] = sfDrawHist(st, 1,2,'\epsilon_{12}', par);
ylims = get(hs,'ylim');
......@@ -61,9 +61,8 @@ ylims = vertcat(ylims{:});
ymin = min(ylims(:,1));
ymax = max(ylims(:,2));
set(hs,'ylim',[ymin ymax])
set(hs(1:3), 'xlim', par.boundnorm)
set(hs(4:6), 'xlim', par.boundshear)
set(hs, 'xlim', [min(minv), max(maxv)])
for ii = 1:6
plot(hs(ii), [0 0], [ymin ymax], 'LineStyle', '-.', 'LineWidth', 2,...
......@@ -78,7 +77,7 @@ end % of main function
%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw histogram
%%%%%%%%%%%%%%%%%%%%%%%%%
function sfDrawHist(st, i1, i2, label, par)
function [minval,maxval] = sfDrawHist(st, i1, i2, label, par)
if (i1 == i2)
edges = par.boundnorm(1) : par.binnorm : par.boundnorm(2);
......@@ -92,10 +91,16 @@ function sfDrawHist(st, i1, i2, label, par)
hst(end) = [];
bar(bins, hst, 'FaceColor',par.facecolor, 'EdgeColor',par.edgecolor)
set(gca, 'fontunits','points', 'fontsize',par.fontsize, 'XTick',par.ticks)
set(gca, 'fontunits','points', 'fontsize',par.fontsize); %, 'XTick',par.ticks)
xlabel(label, 'fontsize', par.fontsize)
grid on
hold on
minval = find(hst,1,'first');
maxval = find(hst,1,'last');
minval = bins(minval);
maxval = bins(maxval);
end
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