binning the x-axis of a plot
8 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Walter Roberson
2016-2-9
xbins = 0 : 0.10 : 20;
4 个评论
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 Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!