Error using boxchart on matrix data

조회 수: 8 (최근 30일)
Yngve Bøe
Yngve Bøe 2021년 5월 6일
댓글: Cris LaPierre 2023년 10월 27일
I am trying to use boxchart() to plot a 3x44 double matrix in Matlab R2020b. Let's call my variable 'Y'. When I call boxchart(Y) I get the following error message:
% Error using boxchart (line 108)
% Data inputs must match the axis configuration. A numeric axis must have numeric data inputs or data inputs which can be converted to double.
Line 108 refers to this:
107 % Configure x-axis and convert xgroupdata to numeric
108 matlab.graphics.internal.configureAxes(cax,xgroupdata,ydata);
I get the same error message if I follow the tutorial here: openExample('graphics/CreateBoxChartsFromMatrixDataExample')
What may be the issue here?
  댓글 수: 4
Thorsten Becker
Thorsten Becker 2021년 8월 25일
i hvae the same issue. I run 2021a
Cris LaPierre
Cris LaPierre 2021년 8월 25일
Please share your code and the complete error message (all the red text)

댓글을 달려면 로그인하십시오.

답변 (1개)

Roelof du Plessis
Roelof du Plessis 2023년 1월 16일
First create a new empty figure before running boxchart. A previous figure with a "hold on" can cause this error.
  댓글 수: 2
Daniel Song
Daniel Song 2023년 10월 27일
I had a similiar issue. This fixes it, thanks
Cris LaPierre
Cris LaPierre 2023년 10월 27일
As a best practice, always pair a 'hold on' with a 'hold off'

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by