Plot only a part of the histogram

I used "histogram(values)" to display the histogram, but:
  • How can I display only the box in red?
  • Is there also a way to stretch (dilate) the values on the x-axis ?

 Accepted Answer

Read about xlim.
xlim([-0.1 0.1])

2 Comments

Alberto Acri
Alberto Acri on 24 Apr 2022
Edited: Alberto Acri on 24 Apr 2022
ok thanks! Is it possible to overlay two histograms with a different color ?
h = histogram(rand(100,1),10) ;
h.FaceColor = 'r' ;

Sign in to comment.

More Answers (0)

Products

Release

R2021b

Asked:

on 23 Apr 2022

Commented:

on 24 Apr 2022

Community Treasure Hunt

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

Start Hunting!