필터 지우기
필터 지우기

putting the data inside the correct x values in hist plot

조회 수: 1 (최근 30일)
Seyhan Emre Gorucu
Seyhan Emre Gorucu 2012년 7월 16일
Hello,
I use hist plot. Let's say that my data is y=[3,5] and I want to make a histogram between x=1:6. I do the following.
y=[3,5]; x=1:6 hist(y,x)
This gives me two vertical bars. One bar is right above 3 and the other bar is right above 5. I want the first one between 2 and 4, and the second one between 5 and 6. Can you help me with this?
Thank you,
  댓글 수: 2
Thomas
Thomas 2012년 7월 16일
The first bar between 2 and 4? or between 2 and 3? if the first bar is between 2-3 wouldn't the second be between 4-5 and not 5-6?
or do you want he bars between 3-4 and 5-6?
Seyhan Emre Gorucu
Seyhan Emre Gorucu 2012년 7월 16일
Hi sorry. You are right. I want the first one between 3-4 and the second between 5-6.

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

채택된 답변

Thomas
Thomas 2012년 7월 16일
y=[3,5]; x=1:6; hist(y+0.5,x+0.5)

추가 답변 (1개)

Seyhan Emre Gorucu
Seyhan Emre Gorucu 2012년 7월 16일
Thank you.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by