binning the x-axis of a plot

조회 수: 8 (최근 30일)
jgillis16
jgillis16 2016년 2월 9일
댓글: Walter Roberson 2016년 2월 9일
I need to create bins for the x-axis of my plot. The axis goes from 0 to 20, and I need to make bins corresponding to every .10 of a value; i.e. 5.0 to 5.10. How would I go about doing this?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 2월 9일
xbins = 0 : 0.10 : 20;
  댓글 수: 4
jgillis16
jgillis16 2016년 2월 9일
I want the x-axis to be binned. So instead of going from 0 to 20, it should go from 0, 0.10, 0.20, etc. Would that be possible? The only thing that's worrying is the matrix sizes are not consistent.
Or, a second axis could work too
Walter Roberson
Walter Roberson 2016년 2월 9일
xbins = 0 : 0.10 : 20;
plot(r,txx2);
set(gca, 'xtick', xbins)
But what I suspect you want is something closer to
bar(r, txx2)

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by