how to plot data with small values
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
I want to plot some result which shows how different is the model A from model B etc. My error is something zero. do you have any idea how I can show that the interpretation would be easy too?
Err 1 Err2 Err3 Err4 Err5
A 0.0142 0 0.0410 0 0
B 0 0 0.0138 0 0
C 0 0 0 0 0
D 0 0 0 0 0
E 0.0142 0 0 0 0
F 0 0 0 0 0
G 0 0 0 0 0
H 0.0135 0 0.0416667 0 0.0138889
채택된 답변
Star Strider
2014년 5월 14일
For example:
Xt = [{'Err1'} {'Err2'} {'Err3'} {'Err4'} {'Err5'}];
Yt = [{'A'} {'B'} {'C'} {'D'} {'E'} {'F'} {'G'} {'H'}];
M = [ 0.0142 0 0.0410 0 0
0 0 0.0138 0 0
0 0 0 0 0
0 0 0 0 0
0.0142 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0.0135 0 0.0416667 0 0.0138889];
figure(1)
bar3(M)
set(gca, 'XTickLabel', Xt)
set(gca, 'YTickLabel', Yt)
produces:

댓글 수: 9
Niki
2014년 5월 14일
this is a classification problem. The error for the first class. for the second class etc. I want to link them together using method A then it can be comparable with method B etc
I have no idea what you want. This is the only way I can think of to plot the data you presented.
Niki
2014년 5월 14일
Thanks! lets see if anyone else give me an idea, if not, Iwill accept your suggestion
Niki
2014년 5월 15일
I did try to plot it as you said
Xt=[{'CCRC1'} {'CCRC2'} {'CCRC3'} {'CCRC4'} {'CPRC1'} {'CPRC2'} {'CPRC3'} {'CPRC4'}]; Yt=[{'A'} {'B'} {'C'} {'D'} {'E'} {'F'} {'G'} {'H'} {'I'} {'AF'} {'AFI'} {'AG'} {'AGI'} {'BF'} {'BFI'} {'BG'} {'BGI'} {'CF'} {'CFI'} {'CG'} {'CGI'} {'DF'} {'DFI'} {'DG'} {'DGI'} {'EF'} {'EFI'} {'EG'} {'EGI'} {'HF'} {'HFI'} {'HG'} {'HGI'} {'MNCN'} {'FI'} {'GI'}]; figure (1) bar3(M) set(gca,'XtickLabel', Xt) set (gca, 'YtickLabel', Yt)
But seems not working very well. if you look at the X axis , it does not show everything . On the other hand, the y axis is very narrow and cause problem. Do you have any suggestion? You can find the results in attachment
I have problems opening your ‘.xls’ file, since it is mixed string and numeric. I simulated your matrix with a same-size random matrix.
Try this:
set(gca, 'XtickLabel', Xt, 'FontSize',6)
set (gca, 'YTick', 1:36, 'YtickLabel', Yt, 'FontSize',6)
view([-45 45])
Did not work,
Here is the data in the attachment
What doesn’t work? It looks good to me.

You are right.I made mistake I used the previous "set" and then over right the last one. anyway I found the same figure as you did. I have one question before I accept your solution. can you please let me know whether you know how to plot it like following figure? because if you see your plot does not show for the last one (one columns before the last is dominating the other) . do you know how to plot it like attached file ?

The ribbon plot is about as close as we can get. You can change the width of the ribbons and rotate the plot to get the result you want:
[X,Y] = meshgrid(1:8, 1:36);
figure(1)
ribbon(Y, M, 0.1)
set(gca, 'Xtick', 1:8, 'XtickLabel', Xt, 'FontSize',6)
set (gca, 'YTick', 1:36, 'YtickLabel', Yt, 'FontSize',6)
view([50 50])
The Xt and Yt cell arrays stay the same. The meshgrid call is new, and the 0.1 is the ribbon width. Otherwise the data are the same.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
