How to plot different grouped boxplots in a shared x axis with different dimensions that are inconsistent?
Hi! I want to ask how to plot this 3 different grouped boxplots in a shared x-axis? because i plan to see the differences between them and add another secondary label to it. I want to make something like in the picture (attached), but I don’t know how to make it work because i keep on having an error that says "dimensions of arrays being concatenated are not consistent".
close all; clear all; clc;
%————————————————————————–
% Data from 1mm
a = load ("All-1mm.txt");
b = load ("Origin-1mm.txt");
% Data from 1mm
c = load ("All-2mm.txt");
d = load ("Origin-2mm.txt");
% Data from 1mm
e = load ("All-3mm.txt");
f = load ("Origin-3mm.txt");
%————————————————————————–
figure
boxplot (a, b);
ylabel ("Displacement (m)");
title(‘1 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels
figure
boxplot (c, d);
ylabel ("Displacement (m)");
title(‘2 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels
figure
boxplot (e, f);
ylabel ("Displacement (m)");
title(‘3 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labelsHi! I want to ask how to plot this 3 different grouped boxplots in a shared x-axis? because i plan to see the differences between them and add another secondary label to it. I want to make something like in the picture (attached), but I don’t know how to make it work because i keep on having an error that says "dimensions of arrays being concatenated are not consistent".
close all; clear all; clc;
%————————————————————————–
% Data from 1mm
a = load ("All-1mm.txt");
b = load ("Origin-1mm.txt");
% Data from 1mm
c = load ("All-2mm.txt");
d = load ("Origin-2mm.txt");
% Data from 1mm
e = load ("All-3mm.txt");
f = load ("Origin-3mm.txt");
%————————————————————————–
figure
boxplot (a, b);
ylabel ("Displacement (m)");
title(‘1 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels
figure
boxplot (c, d);
ylabel ("Displacement (m)");
title(‘2 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels
figure
boxplot (e, f);
ylabel ("Displacement (m)");
title(‘3 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels Hi! I want to ask how to plot this 3 different grouped boxplots in a shared x-axis? because i plan to see the differences between them and add another secondary label to it. I want to make something like in the picture (attached), but I don’t know how to make it work because i keep on having an error that says "dimensions of arrays being concatenated are not consistent".
close all; clear all; clc;
%————————————————————————–
% Data from 1mm
a = load ("All-1mm.txt");
b = load ("Origin-1mm.txt");
% Data from 1mm
c = load ("All-2mm.txt");
d = load ("Origin-2mm.txt");
% Data from 1mm
e = load ("All-3mm.txt");
f = load ("Origin-3mm.txt");
%————————————————————————–
figure
boxplot (a, b);
ylabel ("Displacement (m)");
title(‘1 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels
figure
boxplot (c, d);
ylabel ("Displacement (m)");
title(‘2 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels
figure
boxplot (e, f);
ylabel ("Displacement (m)");
title(‘3 mm Displacement’);
% Set the x-axis tick labels
ax = gca;
ax.XAxis.TickLabelInterpreter = ‘none’; % To display labels without interpreting LaTeX or special characters
ax.XAxis.TickLabels = {‘X’, ‘Y’, ‘Z’, ‘Combined’}; % Assign secondary labels matlab, boxplot, multiple boxplot MATLAB Answers — New Questions