title: How to adjust bar absolute width in MATLAB
body: <p>I'm confused with the bar with adjustment in MATLAB, for example, when use bar like:</p>
  
  <pre><code>bar(randsample(0:0.0001:1,100),randn(100,1))
  </code></pre>
  
  <p>I get an image like this:
  <a href="https://i.stack.imgur.com/NtUgK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NtUgK.jpg" alt="enter image description here"></a></p>
  
  <p>It seems like the bar is too thin to have a good look. After searching for help, I can use the code like:</p>
  
  <pre><code>bar(randsample(0:0.0001:1,100),randn(100,1),50)
  </code></pre>
  
  <p>and I get this:
  <a href="https://i.stack.imgur.com/Vrj54.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vrj54.jpg" alt="enter image description here"></a></p>
  
  <p>Seems much better. But if I change the sample number from 100 to 10, the same code won't work.</p>
  
  <pre><code>bar(randsample(0:0.0001:1,10),randn(10,1),50)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YN4QF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YN4QF.jpg" alt="enter image description here"></a></p>
  
  <p>I hope I have explained my issue clear. It seems like the third parameter of the bar function is a relative width, which correlates to the input size of the first and second parameter. Can I fix the absolute bar width no matter how many data points input? or there is a better function to draw figures like this? Thanks a lot for any help!</p>