Skip to content
Snippets Groups Projects
Verified Commit 38fbab25 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

feat(plots): add colormap tweaks

parent d04725c5
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@ function [allRelDiff, meanDiff, stdDiff] = comparefrequencies(ResData)
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set(0, 'defaulttextinterpreter', 'latex');
allRelDiff = zeros(size(ResData));
for i = 1:size(ResData, 1)
......@@ -29,16 +31,55 @@ function [allRelDiff, meanDiff, stdDiff] = comparefrequencies(ResData)
stdDiff = mean(std(allRelDiff));
figure('Name', 'Frequency differences');
setcolormap();
map = uliegecolors;
hold on;
plot(allFreqF, allFreqA, 'ok', 'MarkerFaceColor', 'k');
for i = 1:2
h = scatter(allFreqF(i, :), allFreqA(i, :), 'filled');
set(h, {'markerfacecolor'}, num2cell(map(1, :), 2));
end
xlim([1.5, 3.5]);
ylim(xlim);
plot(xlim, xlim, '--');
h = plot(xlim, xlim, '--', 'linewidth', 1.1);
set(h, {'color'}, num2cell(map(2, :), 2));
hold off;
grid on;
xlabel('f_{aft} [Hz]');
ylabel('f_{front} [Hz]');
setgca();
xlabel('$\freq_\text{front}$ [Hz]');
ylabel('$\freq_\text{aft}$ [Hz]');
figdir = 'figures/results/';
filename = 'freq_diff.tex';
save2tikz([figdir, filename], '\normalsize');
end
function setgca(varargin)
xticks([1.5:0.5:3.5]);
yticks([1.5:0.5:3.5]);
set(gca, ...
'Box', 'off', ...
'TickDir', 'out', ...
'TickLength', [.02 .02], ...
'XMinorTick', 'off', ...
'YMinorTick', 'off', ...
'YGrid', 'off', ...
'XGrid', 'off', ...
'XColor', 'k', ...
'YColor', 'k', ...
'GridLineStyle', ':', ...
'GridColor', 'k', ...
'GridAlpha', 0.25, ...
'LineWidth', 1, ...
'FontName', 'Helvetica', ...
'Fontsize', 14);
if nargin > 0
set(gca, varargin{:});
end
end
......@@ -73,6 +73,7 @@ function plotwindonoff(ResData)
figure;
ax1 = subplot(3, 1, 1);
setcolormap();
hold on;
plot(meanPeakAngle, meanPeakFon);
......@@ -82,6 +83,7 @@ function plotwindonoff(ResData)
'XLabel', []);
ax2 = subplot(3, 1, 2);
setcolormap();
hold on;
plot(meanPeakAngle, meanPeakFoff);
% plot(meanPeakAngle(round(end / 5)), meanPeakFoff(round(end / 5)), 'or');
......@@ -89,6 +91,7 @@ function plotwindonoff(ResData)
'XLabel', []);
ax3 = subplot(3, 1, 3);
setcolormap();
hold on;
plot(meanPeakAngle, meanDiff);
% plot(meanPeakAngle(round(end / 5)), meanDiff(round(end / 5)), 'or');
......
function setcolormap(map)
% SETS THE COLORMAP
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
axis(); % Make sure axes exists before assigning the colormap
ULIEGE_MAP = uliegecolors;
if nargin == 0
map = ULIEGE_MAP;
end
set(gca, 'ColorOrder', map, 'nextplot', 'replacechildren');
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