How to properly plot a graph for these values in a single plot.

조회 수: 1 (최근 30일)
Karthik K
Karthik K 2018년 8월 29일
편집: Karthik K 2018년 9월 7일
i have X as lables, Y Y1 Y2 are performance measures. i want all of these in a single graph. I tried this code
hfig = figure ;
p=plot(X,Y,X,Y1,X,Y2);
title('Performance Curve')
xlabel('Labels')
but i got a graph like , which is not clear. How to modify this. Also i need to display at a side in the graph what is Y Y1 Y2. bar graph is also fine if its good.

답변 (1개)

Dimitris Kalogiros
Dimitris Kalogiros 2018년 8월 29일
Your problem is data into X .
Matlab expects that X contains numeric values. But in your case, if you display values of X , you shall see that it contains strings.
You must convert these strings to numbers.
  댓글 수: 1
Karthik K
Karthik K 2018년 8월 29일
편집: Karthik K 2018년 9월 7일
X can be categorical.. plot is working with the data. But my Plotting is not neat here. So i wanted to do it neatly. Since 53 values are present its not properly fitting in the area of the graph. If width is increased it can be done. Also i need to display what are Y Y1 Y2 at a side inside graph.

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by