Clear Filters
Clear Filters

i want to determine lower and upper points in histigram

2 views (last 30 days)
i have a column and i plot its values as a normal histogram but i can't determine this histogram between two points .
such as
histfit(y,10,'normal') , i want that the histogram appears between (-1 , 1)

Accepted Answer

SvB
SvB on 28 Feb 2018
If you only want to shift the view of the histogram, simply use
xlim([-1 1])
%and/or
ylim([-1 1])
so show only that part of the histogram that appears between (-1,1). (I'm not sure what axis you meant, so try both :) ).
If you instead meant that you want the data to appear between (-1, 1), you'd actually have to adjust y itself to ensure no values are smaller than -1 or larger than 1, but I doubt that's what you're after.
  1 Comment
Steven Lord
Steven Lord on 1 Mar 2018
Or if you want to bin only the data between -1 and 1, specify 'BinLimits' when you call the histogram function. See the documentation for that Name-Value Pair Argument on the histogram documentation page for more information on this argument.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!