Not getting correct values on boxplot from imported excel data

3 ビュー (過去 30 日間)
Jared Kimble
Jared Kimble 2022 年 4 月 29 日
編集済み: Cris LaPierre 2022 年 4 月 29 日
I am attempting to code two boxplots for comparisons on one plot. The boxplot is showing from 0 to about 12 on the left and 0 to 13 on the right no matter what I change. The data in the first column with numbers is in the 0.08 to like 0.15. The green and red are two data different data sets readSwingVec = xlsread('DigiPractice.xlsx', 'Sheet1', 'A11:AT19'); readSwingAlp = xlsread('DigiPractice.xlsx', 'Sheet1', 'A2:AT10');
SwingVec = readSwingVec(:,1); SwingAlp = readSwingAlp(:,1); SwingAandV = [SwingAlp, SwingVec];
% Plotting and formatting of plot figure(1) T = boxplot(SwingAandV); boxplot(T,'Labels',{'Alpl/fl','Vecko'})
  2 件のコメント
Cris LaPierre
Cris LaPierre 2022 年 4 月 29 日
Without your data, it will be hard to say anything specific. Please attach your spreadsheet using the paperclip. Also, please copy/paste your code. That makes it easier for us to test.
Jared Kimble
Jared Kimble 2022 年 4 月 29 日
Okay I have done that

サインインしてコメントする。

採用された回答

Voss
Voss 2022 年 4 月 29 日
編集済み: Voss 2022 年 4 月 29 日
readSwingVec = xlsread('DigiPractice.xlsx', 'Sheet1', 'A11:AT19');
readSwingAlp = xlsread('DigiPractice.xlsx', 'Sheet1', 'A2:AT10');
SwingVec = readSwingVec(:,1);
SwingAlp = readSwingAlp(:,1);
SwingAandV = [SwingAlp, SwingVec];
% Plotting and formatting of plot
figure(1)
T = boxplot(SwingAandV,'Labels',{'Alpl/fl','Vecko'});
whos T
Name Size Bytes Class Attributes T 7x2 112 double
T
T = 7×2
10.0027 17.0002 11.0004 18.0002 12.0004 19.0002 13.0004 20.0002 14.0004 21.0002 15.0004 22.0002 16.0002 23.0002
ishandle(T)
ans = 7×2 logical array
1 1 1 1 1 1 1 1 1 1 1 1 1 1
% When you do this, instead of having the effect of updating the boxplot
% you just created, you are calling boxplot on the line handles of the
% previous boxplot (which happen to have numeric values around 10~23 in
% this case), which deletes the previous boxplot and makes a new one from
% those numbers. Instead, include the Labels in the previous boxplot call.
boxplot(T,'Labels',{'Alpl/fl','Vecko'})

その他の回答 (0 件)

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by